@@ -247,6 +247,7 @@ class PeerManagerImpl final : public PeerManager
247
247
bool GetNodeStateStats (NodeId nodeid, CNodeStateStats& stats) override ;
248
248
bool IgnoresIncomingTxs () override { return m_ignore_incoming_txs; }
249
249
void SendPings () override ;
250
+ void RelayTransaction (const uint256& txid, const uint256& wtxid) override ;
250
251
void SetBestHeight (int height) override { m_best_height = height; };
251
252
void Misbehaving (const NodeId pnode, const int howmuch, const std::string& message) override ;
252
253
void ProcessMessage (CNode& pfrom, const std::string& msg_type, CDataStream& vRecv,
@@ -260,7 +261,7 @@ class PeerManagerImpl final : public PeerManager
260
261
void EvictExtraOutboundPeers (int64_t time_in_seconds) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
261
262
262
263
/* * Retrieve unbroadcast transactions from the mempool and reattempt sending to peers */
263
- void ReattemptInitialBroadcast (CScheduler& scheduler) const ;
264
+ void ReattemptInitialBroadcast (CScheduler& scheduler);
264
265
265
266
/* * Get a shared pointer to the Peer object.
266
267
* May return an empty shared_ptr if the Peer object can't be found. */
@@ -949,7 +950,7 @@ void PeerManagerImpl::InitializeNode(CNode *pnode)
949
950
}
950
951
}
951
952
952
- void PeerManagerImpl::ReattemptInitialBroadcast (CScheduler& scheduler) const
953
+ void PeerManagerImpl::ReattemptInitialBroadcast (CScheduler& scheduler)
953
954
{
954
955
std::set<uint256> unbroadcast_txids = m_mempool.GetUnbroadcastTxs ();
955
956
@@ -958,7 +959,7 @@ void PeerManagerImpl::ReattemptInitialBroadcast(CScheduler& scheduler) const
958
959
959
960
if (tx != nullptr ) {
960
961
LOCK (cs_main);
961
- RelayTransaction (txid, tx->GetWitnessHash (), m_connman );
962
+ RelayTransaction (txid, tx->GetWitnessHash ());
962
963
} else {
963
964
m_mempool.RemoveUnbroadcastTx (txid, true );
964
965
}
@@ -1460,9 +1461,9 @@ void PeerManagerImpl::SendPings()
1460
1461
for (auto & it : m_peer_map) it.second ->m_ping_queued = true ;
1461
1462
}
1462
1463
1463
- void RelayTransaction (const uint256& txid, const uint256& wtxid, const CConnman& connman )
1464
+ void PeerManagerImpl:: RelayTransaction (const uint256& txid, const uint256& wtxid)
1464
1465
{
1465
- connman .ForEachNode ([&txid, &wtxid](CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED (::cs_main) {
1466
+ m_connman .ForEachNode ([&txid, &wtxid](CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED (::cs_main) {
1466
1467
AssertLockHeld (::cs_main);
1467
1468
1468
1469
CNodeState* state = State (pnode->GetId ());
@@ -2042,7 +2043,7 @@ void PeerManagerImpl::ProcessOrphanTx(std::set<uint256>& orphan_work_set)
2042
2043
2043
2044
if (result.m_result_type == MempoolAcceptResult::ResultType::VALID) {
2044
2045
LogPrint (BCLog::MEMPOOL, " accepted orphan tx %s\n " , orphanHash.ToString ());
2045
- RelayTransaction (orphanHash, porphanTx->GetWitnessHash (), m_connman );
2046
+ RelayTransaction (orphanHash, porphanTx->GetWitnessHash ());
2046
2047
m_orphanage.AddChildrenToWorkSet (*porphanTx, orphan_work_set);
2047
2048
m_orphanage.EraseTx (orphanHash);
2048
2049
for (const CTransactionRef& removedTx : result.m_replaced_transactions .value ()) {
@@ -3046,7 +3047,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
3046
3047
LogPrintf (" Not relaying non-mempool transaction %s from forcerelay peer=%d\n " , tx.GetHash ().ToString (), pfrom.GetId ());
3047
3048
} else {
3048
3049
LogPrintf (" Force relaying tx %s from peer=%d\n " , tx.GetHash ().ToString (), pfrom.GetId ());
3049
- RelayTransaction (tx.GetHash (), tx.GetWitnessHash (), m_connman );
3050
+ RelayTransaction (tx.GetHash (), tx.GetWitnessHash ());
3050
3051
}
3051
3052
}
3052
3053
return ;
@@ -3061,7 +3062,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
3061
3062
// requests for it.
3062
3063
m_txrequest.ForgetTxHash (tx.GetHash ());
3063
3064
m_txrequest.ForgetTxHash (tx.GetWitnessHash ());
3064
- RelayTransaction (tx.GetHash (), tx.GetWitnessHash (), m_connman );
3065
+ RelayTransaction (tx.GetHash (), tx.GetWitnessHash ());
3065
3066
m_orphanage.AddChildrenToWorkSet (tx, peer->m_orphan_work_set );
3066
3067
3067
3068
pfrom.nLastTXTime = GetTime ();
0 commit comments