@@ -440,6 +440,19 @@ class PeerManagerImpl final : public PeerManager
440
440
441
441
/* * When our tip was last updated. */
442
442
std::atomic<int64_t > m_last_tip_update{0 };
443
+
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);
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);
448
+
449
+ /* * Relay map (txid or wtxid -> CTransactionRef) */
450
+ typedef std::map<uint256, CTransactionRef> MapRelay;
451
+ MapRelay mapRelay GUARDED_BY (cs_main);
452
+ /* * Expiration-time ordered list of (expire time, relay map entry) pairs. */
453
+ std::deque<std::pair<int64_t , MapRelay::iterator>> vRelayExpiration GUARDED_BY (cs_main);
454
+
455
+
443
456
};
444
457
} // namespace
445
458
@@ -453,12 +466,6 @@ namespace {
453
466
/* * Number of peers from which we're downloading blocks. */
454
467
int nPeersWithValidatedDownloads GUARDED_BY (cs_main) = 0;
455
468
456
- /* * Relay map (txid or wtxid -> CTransactionRef) */
457
- typedef std::map<uint256, CTransactionRef> MapRelay;
458
- MapRelay mapRelay GUARDED_BY (cs_main);
459
- /* * Expiration-time ordered list of (expire time, relay map entry) pairs. */
460
- std::deque<std::pair<int64_t , MapRelay::iterator>> vRelayExpiration GUARDED_BY (cs_main);
461
-
462
469
struct IteratorComparator
463
470
{
464
471
template <typename I>
@@ -1844,8 +1851,7 @@ void static ProcessGetBlockData(CNode& pfrom, Peer& peer, const CChainParams& ch
1844
1851
}
1845
1852
}
1846
1853
1847
- // ! Determine whether or not a peer can request a transaction, and return it (or nullptr if not found or not allowed).
1848
- 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)
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)
1849
1855
{
1850
1856
auto txinfo = mempool.info (gtxid);
1851
1857
if (txinfo.tx ) {
@@ -1872,7 +1878,7 @@ static CTransactionRef FindTxForGetData(const CTxMemPool& mempool, const CNode&
1872
1878
return {};
1873
1879
}
1874
1880
1875
- void static 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 CChainParams& chainparams, CConnman& connman, CTxMemPool& mempool, const std::atomic<bool >& interruptMsgProc) EXCLUSIVE_LOCKS_REQUIRED(!cs_main, peer.m_getdata_requests_mutex)
1876
1882
{
1877
1883
AssertLockNotHeld (cs_main);
1878
1884
0 commit comments