@@ -1453,7 +1453,7 @@ bool static AlreadyHave(const CInv& inv, const CTxMemPool& mempool) EXCLUSIVE_LO
1453
1453
if (g_recent_confirmed_transactions->contains (inv.hash )) return true ;
1454
1454
}
1455
1455
1456
- return recentRejects->contains (inv.hash ) || mempool.exists (inv. hash , inv. IsMsgWtx ( ));
1456
+ return recentRejects->contains (inv.hash ) || mempool.exists (ToGenTxid (inv ));
1457
1457
}
1458
1458
case MSG_BLOCK:
1459
1459
case MSG_WITNESS_BLOCK:
@@ -1673,7 +1673,7 @@ void static ProcessGetBlockData(CNode& pfrom, const CChainParams& chainparams, c
1673
1673
// ! Determine whether or not a peer can request a transaction, and return it (or nullptr if not found or not allowed).
1674
1674
CTransactionRef static FindTxForGetData (const CNode& peer, const GenTxid& gtxid, const std::chrono::seconds mempool_req, const std::chrono::seconds now) LOCKS_EXCLUDED(cs_main)
1675
1675
{
1676
- auto txinfo = mempool.info (gtxid. GetHash (), gtxid. IsWtxid () );
1676
+ auto txinfo = mempool.info (gtxid);
1677
1677
if (txinfo.tx ) {
1678
1678
// If a TX could have been INVed in reply to a MEMPOOL request,
1679
1679
// or is older than UNCONDITIONAL_RELAY_DELAY, permit the request
@@ -4358,14 +4358,15 @@ bool PeerLogicValidation::SendMessages(CNode* pto)
4358
4358
std::set<uint256>::iterator it = vInvTx.back ();
4359
4359
vInvTx.pop_back ();
4360
4360
uint256 hash = *it;
4361
+ CInv inv (state.m_wtxid_relay ? MSG_WTX : MSG_TX, hash);
4361
4362
// Remove it from the to-be-sent set
4362
4363
pto->m_tx_relay ->setInventoryTxToSend .erase (it);
4363
4364
// Check if not in the filter already
4364
4365
if (pto->m_tx_relay ->filterInventoryKnown .contains (hash)) {
4365
4366
continue ;
4366
4367
}
4367
4368
// Not in the mempool anymore? don't bother sending it.
4368
- auto txinfo = m_mempool.info (hash, state. m_wtxid_relay );
4369
+ auto txinfo = m_mempool.info (ToGenTxid (inv) );
4369
4370
if (!txinfo.tx ) {
4370
4371
continue ;
4371
4372
}
@@ -4378,7 +4379,7 @@ bool PeerLogicValidation::SendMessages(CNode* pto)
4378
4379
if (pto->m_tx_relay ->pfilter && !pto->m_tx_relay ->pfilter ->IsRelevantAndUpdate (*txinfo.tx )) continue ;
4379
4380
// Send
4380
4381
State (pto->GetId ())->m_recently_announced_invs .insert (hash);
4381
- vInv.push_back (CInv (state. m_wtxid_relay ? MSG_WTX : MSG_TX, hash) );
4382
+ vInv.push_back (inv );
4382
4383
nRelayedTransactions++;
4383
4384
{
4384
4385
// Expire old relay messages
0 commit comments