@@ -363,7 +363,7 @@ class PeerManagerImpl final : public PeerManager
363
363
/* * Number of outbound peers with m_chain_sync.m_protect. */
364
364
int m_outbound_peers_with_protect_from_disconnect GUARDED_BY (cs_main) = 0;
365
365
366
- bool AlreadyHaveTx (const GenTxid& gtxid, const CTxMemPool& mempool ) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
366
+ bool AlreadyHaveTx (const GenTxid& gtxid) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
367
367
368
368
/* *
369
369
* Filter for transactions that were recently rejected by
@@ -1565,7 +1565,7 @@ void PeerManagerImpl::BlockChecked(const CBlock& block, const BlockValidationSta
1565
1565
//
1566
1566
1567
1567
1568
- bool PeerManagerImpl::AlreadyHaveTx (const GenTxid& gtxid, const CTxMemPool& mempool ) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
1568
+ bool PeerManagerImpl::AlreadyHaveTx (const GenTxid& gtxid) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
1569
1569
{
1570
1570
assert (recentRejects);
1571
1571
if (::ChainActive ().Tip ()->GetBlockHash () != hashRecentRejectsChainTip) {
@@ -1593,7 +1593,7 @@ bool PeerManagerImpl::AlreadyHaveTx(const GenTxid& gtxid, const CTxMemPool& memp
1593
1593
if (m_recent_confirmed_transactions->contains (hash)) return true ;
1594
1594
}
1595
1595
1596
- return recentRejects->contains (hash) || mempool .exists (gtxid);
1596
+ return recentRejects->contains (hash) || m_mempool .exists (gtxid);
1597
1597
}
1598
1598
1599
1599
bool static AlreadyHaveBlock (const uint256& block_hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
@@ -2903,7 +2903,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
2903
2903
}
2904
2904
} else if (inv.IsGenTxMsg ()) {
2905
2905
const GenTxid gtxid = ToGenTxid (inv);
2906
- const bool fAlreadyHave = AlreadyHaveTx (gtxid, m_mempool );
2906
+ const bool fAlreadyHave = AlreadyHaveTx (gtxid);
2907
2907
LogPrint (BCLog::NET, " got inv: %s %s peer=%d\n " , inv.ToString (), fAlreadyHave ? " have" : " new" , pfrom.GetId ());
2908
2908
2909
2909
pfrom.AddKnownTx (inv.hash );
@@ -3184,7 +3184,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
3184
3184
// already; and an adversary can already relay us old transactions
3185
3185
// (older than our recency filter) if trying to DoS us, without any need
3186
3186
// for witness malleation.
3187
- if (AlreadyHaveTx (GenTxid (/* is_wtxid=*/ true , wtxid), m_mempool )) {
3187
+ if (AlreadyHaveTx (GenTxid (/* is_wtxid=*/ true , wtxid))) {
3188
3188
if (pfrom.HasPermission (PF_FORCERELAY)) {
3189
3189
// Always relay transactions received from peers with forcerelay
3190
3190
// permission, even if they were already in the mempool, allowing
@@ -3263,7 +3263,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
3263
3263
// protocol for getting all unconfirmed parents.
3264
3264
const GenTxid gtxid{/* is_wtxid=*/ false , parent_txid};
3265
3265
pfrom.AddKnownTx (parent_txid);
3266
- if (!AlreadyHaveTx (gtxid, m_mempool )) AddTxAnnouncement (pfrom, gtxid, current_time);
3266
+ if (!AlreadyHaveTx (gtxid)) AddTxAnnouncement (pfrom, gtxid, current_time);
3267
3267
}
3268
3268
AddOrphanTx (ptx, pfrom.GetId ());
3269
3269
@@ -4804,7 +4804,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
4804
4804
entry.second .GetHash ().ToString (), entry.first );
4805
4805
}
4806
4806
for (const GenTxid& gtxid : requestable) {
4807
- if (!AlreadyHaveTx (gtxid, m_mempool )) {
4807
+ if (!AlreadyHaveTx (gtxid)) {
4808
4808
LogPrint (BCLog::NET, " Requesting %s %s peer=%d\n " , gtxid.IsWtxid () ? " wtx" : " tx" ,
4809
4809
gtxid.GetHash ().ToString (), pto->GetId ());
4810
4810
vGetData.emplace_back (gtxid.IsWtxid () ? MSG_WTX : (MSG_TX | GetFetchFlags (*pto)), gtxid.GetHash ());
0 commit comments