Skip to content

Commit a9bc563

Browse files
committed
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.
1 parent 9f4c0a9 commit a9bc563

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/net_processing.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,13 +1627,6 @@ CTransactionRef static FindTxForGetData(CNode& peer, const uint256& txid, const
16271627
if (peer.m_tx_relay->setInventoryTxToSend.count(txid)) return {};
16281628
}
16291629

1630-
{
1631-
LOCK(cs_main);
1632-
// Look up transaction in relay pool
1633-
auto mi = mapRelay.find(txid);
1634-
if (mi != mapRelay.end()) return mi->second;
1635-
}
1636-
16371630
auto txinfo = mempool.info(txid);
16381631
if (txinfo.tx) {
16391632
// To protect privacy, do not answer getdata using the mempool when
@@ -1644,6 +1637,13 @@ CTransactionRef static FindTxForGetData(CNode& peer, const uint256& txid, const
16441637
}
16451638
}
16461639

1640+
{
1641+
LOCK(cs_main);
1642+
// Look up transaction in relay pool
1643+
auto mi = mapRelay.find(txid);
1644+
if (mi != mapRelay.end()) return mi->second;
1645+
}
1646+
16471647
return {};
16481648
}
16491649

0 commit comments

Comments
 (0)