Skip to content

Commit fa0359c

Browse files
author
MarcoFalke
committed
Remove mempool global from p2p
1 parent eeee110 commit fa0359c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/net_processing.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,7 @@ void static ProcessGetBlockData(CNode& pfrom, const CChainParams& chainparams, c
17101710
}
17111711

17121712
//! Determine whether or not a peer can request a transaction, and return it (or nullptr if not found or not allowed).
1713-
CTransactionRef static FindTxForGetData(const CNode& peer, const GenTxid& gtxid, const std::chrono::seconds mempool_req, const std::chrono::seconds now) LOCKS_EXCLUDED(cs_main)
1713+
static CTransactionRef FindTxForGetData(const CTxMemPool& mempool, const CNode& peer, const GenTxid& gtxid, const std::chrono::seconds mempool_req, const std::chrono::seconds now) LOCKS_EXCLUDED(cs_main)
17141714
{
17151715
auto txinfo = mempool.info(gtxid);
17161716
if (txinfo.tx) {
@@ -1766,7 +1766,7 @@ void static ProcessGetData(CNode& pfrom, const CChainParams& chainparams, CConnm
17661766
continue;
17671767
}
17681768

1769-
CTransactionRef tx = FindTxForGetData(pfrom, ToGenTxid(inv), mempool_req, now);
1769+
CTransactionRef tx = FindTxForGetData(mempool, pfrom, ToGenTxid(inv), mempool_req, now);
17701770
if (tx) {
17711771
// WTX and WITNESS_TX imply we serialize with witness
17721772
int nSendFlags = (inv.IsMsgTx() ? SERIALIZE_TRANSACTION_NO_WITNESS : 0);
@@ -2732,7 +2732,7 @@ void PeerLogicValidation::ProcessMessage(CNode& pfrom, const std::string& msg_ty
27322732
}
27332733
} else if (inv.IsGenTxMsg()) {
27342734
const GenTxid gtxid = ToGenTxid(inv);
2735-
const bool fAlreadyHave = AlreadyHaveTx(gtxid, mempool);
2735+
const bool fAlreadyHave = AlreadyHaveTx(gtxid, m_mempool);
27362736
LogPrint(BCLog::NET, "got inv: %s %s peer=%d\n", inv.ToString(), fAlreadyHave ? "have" : "new", pfrom.GetId());
27372737

27382738
pfrom.AddKnownTx(inv.hash);
@@ -3003,7 +3003,7 @@ void PeerLogicValidation::ProcessMessage(CNode& pfrom, const std::string& msg_ty
30033003

30043004
std::list<CTransactionRef> lRemovedTxn;
30053005

3006-
// We do the AlreadyHave() check using wtxid, rather than txid - in the
3006+
// We do the AlreadyHaveTx() check using wtxid, rather than txid - in the
30073007
// absence of witness malleation, this is strictly better, because the
30083008
// recent rejects filter may contain the wtxid but rarely contains
30093009
// the txid of a segwit transaction that has been rejected.

0 commit comments

Comments
 (0)