mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 12:22:39 -03:00
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.
This commit is contained in:
parent
9f4c0a9694
commit
a9bc563803
1 changed files with 7 additions and 7 deletions
|
@ -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 {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue