@@ -947,7 +947,7 @@ class PeerManagerImpl final : public PeerManager
947
947
std::atomic<std::chrono::seconds> m_last_tip_update{0s};
948
948
949
949
/* * Determine whether or not a peer can request a transaction, and return it (or nullptr if not found or not allowed). */
950
- CTransactionRef FindTxForGetData (const Peer::TxRelay& tx_relay, const CInv& inv )
950
+ CTransactionRef FindTxForGetData (const Peer::TxRelay& tx_relay, const GenTxid& gtxid )
951
951
EXCLUSIVE_LOCKS_REQUIRED(!m_most_recent_block_mutex, NetEventsInterface::g_msgproc_mutex);
952
952
953
953
void ProcessGetData (CNode& pfrom, Peer& peer, const std::atomic<bool >& interruptMsgProc)
@@ -2391,15 +2391,14 @@ void PeerManagerImpl::ProcessGetBlockData(CNode& pfrom, Peer& peer, const CInv&
2391
2391
}
2392
2392
}
2393
2393
2394
- CTransactionRef PeerManagerImpl::FindTxForGetData (const Peer::TxRelay& tx_relay, const CInv& inv )
2394
+ CTransactionRef PeerManagerImpl::FindTxForGetData (const Peer::TxRelay& tx_relay, const GenTxid& gtxid )
2395
2395
{
2396
- auto gtxid{ToGenTxid (inv)};
2397
- // If a tx was in the mempool prior to the last INV for this peer, permit the request.
2398
2396
auto txinfo{std::visit (
2399
2397
[&](const auto & id) EXCLUSIVE_LOCKS_REQUIRED (NetEventsInterface::g_msgproc_mutex) {
2400
2398
return m_mempool.info_for_relay (id, tx_relay.m_last_inv_sequence );
2401
2399
},
2402
2400
gtxid)};
2401
+
2403
2402
if (txinfo.tx ) {
2404
2403
return std::move (txinfo.tx );
2405
2404
}
@@ -2442,7 +2441,7 @@ void PeerManagerImpl::ProcessGetData(CNode& pfrom, Peer& peer, const std::atomic
2442
2441
continue ;
2443
2442
}
2444
2443
2445
- if (auto tx{FindTxForGetData (*tx_relay, inv)}) {
2444
+ if (auto tx{FindTxForGetData (*tx_relay, ToGenTxid ( inv) )}) {
2446
2445
// WTX and WITNESS_TX imply we serialize with witness
2447
2446
const auto maybe_with_witness = (inv.IsMsgTx () ? TX_NO_WITNESS : TX_WITH_WITNESS);
2448
2447
MakeAndPushMessage (pfrom, NetMsgType::TX, maybe_with_witness (*tx));
0 commit comments