aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2020-06-01 10:53:03 -0700
committerPieter Wuille <pieter@wuille.net>2020-07-08 18:28:00 -0700
commita9bc5638031a29abaa40284273a3507b345c31e9 (patch)
treea4ab9d0f6b3a5d17d6b104954ae212f65170e1d8 /src/net_processing.cpp
parent9f4c0a9694d399388d0514c13feae7d2303fac3d (diff)
downloadbitcoin-a9bc5638031a29abaa40284273a3507b345c31e9.tar.xz
Swap relay pool and mempool lookup
This is in preparation to using the mempool entering time as part of the decision for relay, but does not change behavior on itself.
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index f1a89a8936..07c12938c8 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -1627,13 +1627,6 @@ CTransactionRef static FindTxForGetData(CNode& peer, const uint256& txid, const
if (peer.m_tx_relay->setInventoryTxToSend.count(txid)) return {};
}
- {
- LOCK(cs_main);
- // Look up transaction in relay pool
- auto mi = mapRelay.find(txid);
- if (mi != mapRelay.end()) return mi->second;
- }
-
auto txinfo = mempool.info(txid);
if (txinfo.tx) {
// To protect privacy, do not answer getdata using the mempool when
@@ -1644,6 +1637,13 @@ CTransactionRef static FindTxForGetData(CNode& peer, const uint256& txid, const
}
}
+ {
+ LOCK(cs_main);
+ // Look up transaction in relay pool
+ auto mi = mapRelay.find(txid);
+ if (mi != mapRelay.end()) return mi->second;
+ }
+
return {};
}