@@ -442,9 +442,9 @@ class PeerManagerImpl final : public PeerManager
442
442
std::atomic<int64_t > m_last_tip_update{0 };
443
443
444
444
/* * Determine whether or not a peer can request a transaction, and return it (or nullptr if not found or not allowed). */
445
- 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);
445
+ CTransactionRef FindTxForGetData (const CNode& peer, const GenTxid& gtxid, const std::chrono::seconds mempool_req, const std::chrono::seconds now) LOCKS_EXCLUDED(cs_main);
446
446
447
- void ProcessGetData (CNode& pfrom, Peer& peer, const CChainParams& chainparams, CConnman& connman, CTxMemPool& mempool, const std::atomic<bool >& interruptMsgProc) EXCLUSIVE_LOCKS_REQUIRED(!cs_main, peer.m_getdata_requests_mutex);
447
+ void ProcessGetData (CNode& pfrom, Peer& peer, const std::atomic<bool >& interruptMsgProc) EXCLUSIVE_LOCKS_REQUIRED(!cs_main, peer.m_getdata_requests_mutex);
448
448
449
449
/* * Relay map (txid or wtxid -> CTransactionRef) */
450
450
typedef std::map<uint256, CTransactionRef> MapRelay;
@@ -1851,9 +1851,9 @@ void static ProcessGetBlockData(CNode& pfrom, Peer& peer, const CChainParams& ch
1851
1851
}
1852
1852
}
1853
1853
1854
- CTransactionRef PeerManagerImpl::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)
1854
+ CTransactionRef PeerManagerImpl::FindTxForGetData (const CNode& peer, const GenTxid& gtxid, const std::chrono::seconds mempool_req, const std::chrono::seconds now) LOCKS_EXCLUDED(cs_main)
1855
1855
{
1856
- auto txinfo = mempool .info (gtxid);
1856
+ auto txinfo = m_mempool .info (gtxid);
1857
1857
if (txinfo.tx ) {
1858
1858
// If a TX could have been INVed in reply to a MEMPOOL request,
1859
1859
// or is older than UNCONDITIONAL_RELAY_DELAY, permit the request
@@ -1878,7 +1878,7 @@ CTransactionRef PeerManagerImpl::FindTxForGetData(const CTxMemPool& mempool, con
1878
1878
return {};
1879
1879
}
1880
1880
1881
- void PeerManagerImpl::ProcessGetData (CNode& pfrom, Peer& peer, const CChainParams& chainparams, CConnman& connman, CTxMemPool& mempool, const std::atomic<bool >& interruptMsgProc) EXCLUSIVE_LOCKS_REQUIRED(!cs_main, peer.m_getdata_requests_mutex)
1881
+ void PeerManagerImpl::ProcessGetData (CNode& pfrom, Peer& peer, const std::atomic<bool >& interruptMsgProc) EXCLUSIVE_LOCKS_REQUIRED(!cs_main, peer.m_getdata_requests_mutex)
1882
1882
{
1883
1883
AssertLockNotHeld (cs_main);
1884
1884
@@ -1907,17 +1907,17 @@ void PeerManagerImpl::ProcessGetData(CNode& pfrom, Peer& peer, const CChainParam
1907
1907
continue ;
1908
1908
}
1909
1909
1910
- CTransactionRef tx = FindTxForGetData (mempool, pfrom, ToGenTxid (inv), mempool_req, now);
1910
+ CTransactionRef tx = FindTxForGetData (pfrom, ToGenTxid (inv), mempool_req, now);
1911
1911
if (tx) {
1912
1912
// WTX and WITNESS_TX imply we serialize with witness
1913
1913
int nSendFlags = (inv.IsMsgTx () ? SERIALIZE_TRANSACTION_NO_WITNESS : 0 );
1914
- connman .PushMessage (&pfrom, msgMaker.Make (nSendFlags, NetMsgType::TX, *tx));
1915
- mempool .RemoveUnbroadcastTx (tx->GetHash ());
1914
+ m_connman .PushMessage (&pfrom, msgMaker.Make (nSendFlags, NetMsgType::TX, *tx));
1915
+ m_mempool .RemoveUnbroadcastTx (tx->GetHash ());
1916
1916
// As we're going to send tx, make sure its unconfirmed parents are made requestable.
1917
1917
std::vector<uint256> parent_ids_to_add;
1918
1918
{
1919
- LOCK (mempool .cs );
1920
- auto txiter = mempool .GetIter (tx->GetHash ());
1919
+ LOCK (m_mempool .cs );
1920
+ auto txiter = m_mempool .GetIter (tx->GetHash ());
1921
1921
if (txiter) {
1922
1922
const CTxMemPoolEntry::Parents& parents = (*txiter)->GetMemPoolParentsConst ();
1923
1923
parent_ids_to_add.reserve (parents.size ());
@@ -1945,7 +1945,7 @@ void PeerManagerImpl::ProcessGetData(CNode& pfrom, Peer& peer, const CChainParam
1945
1945
if (it != peer.m_getdata_requests .end () && !pfrom.fPauseSend ) {
1946
1946
const CInv &inv = *it++;
1947
1947
if (inv.IsGenBlkMsg ()) {
1948
- ProcessGetBlockData (pfrom, peer, chainparams , inv, connman );
1948
+ ProcessGetBlockData (pfrom, peer, m_chainparams , inv, m_connman );
1949
1949
}
1950
1950
// else: If the first item on the queue is an unknown type, we erase it
1951
1951
// and continue processing the queue on the next call.
@@ -1968,7 +1968,7 @@ void PeerManagerImpl::ProcessGetData(CNode& pfrom, Peer& peer, const CChainParam
1968
1968
// In normal operation, we often send NOTFOUND messages for parents of
1969
1969
// transactions that we relay; if a peer is missing a parent, they may
1970
1970
// assume we have them and request the parents from us.
1971
- connman .PushMessage (&pfrom, msgMaker.Make (NetMsgType::NOTFOUND, vNotFound));
1971
+ m_connman .PushMessage (&pfrom, msgMaker.Make (NetMsgType::NOTFOUND, vNotFound));
1972
1972
}
1973
1973
}
1974
1974
@@ -2968,7 +2968,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
2968
2968
{
2969
2969
LOCK (peer->m_getdata_requests_mutex );
2970
2970
peer->m_getdata_requests .insert (peer->m_getdata_requests .end (), vInv.begin (), vInv.end ());
2971
- ProcessGetData (pfrom, *peer, m_chainparams, m_connman, m_mempool, interruptMsgProc);
2971
+ ProcessGetData (pfrom, *peer, interruptMsgProc);
2972
2972
}
2973
2973
2974
2974
return ;
@@ -4043,7 +4043,7 @@ bool PeerManagerImpl::ProcessMessages(CNode* pfrom, std::atomic<bool>& interrupt
4043
4043
{
4044
4044
LOCK (peer->m_getdata_requests_mutex );
4045
4045
if (!peer->m_getdata_requests .empty ()) {
4046
- ProcessGetData (*pfrom, *peer, m_chainparams, m_connman, m_mempool, interruptMsgProc);
4046
+ ProcessGetData (*pfrom, *peer, interruptMsgProc);
4047
4047
}
4048
4048
}
4049
4049
0 commit comments