@@ -589,7 +589,7 @@ class PeerManagerImpl final : public PeerManager
589
589
*/
590
590
bool MaybeDiscourageAndDisconnect (CNode& pnode, Peer& peer);
591
591
592
- void ProcessOrphanTx (std::set<uint256>& orphan_work_set ) EXCLUSIVE_LOCKS_REQUIRED(cs_main, g_cs_orphans)
592
+ void ProcessOrphanTx (Peer& peer ) EXCLUSIVE_LOCKS_REQUIRED(cs_main, g_cs_orphans)
593
593
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, g_msgproc_mutex);
594
594
/* * Process a single headers message from a peer.
595
595
*
@@ -2878,20 +2878,20 @@ void PeerManagerImpl::ProcessHeadersMessage(CNode& pfrom, Peer& peer,
2878
2878
/* *
2879
2879
* Reconsider orphan transactions after a parent has been accepted to the mempool.
2880
2880
*
2881
- * @param [in,out ] orphan_work_set The set of orphan transactions to reconsider. Generally only one
2881
+ * @peer [in] peer The peer whose orphan transactions we will reconsider. Generally only one
2882
2882
* orphan will be reconsidered on each call of this function. This set
2883
2883
* may be added to if accepting an orphan causes its children to be
2884
2884
* reconsidered.
2885
2885
*/
2886
- void PeerManagerImpl::ProcessOrphanTx (std::set<uint256>& orphan_work_set )
2886
+ void PeerManagerImpl::ProcessOrphanTx (Peer& peer )
2887
2887
{
2888
2888
AssertLockHeld (g_msgproc_mutex);
2889
2889
AssertLockHeld (cs_main);
2890
2890
AssertLockHeld (g_cs_orphans);
2891
2891
2892
- while (!orphan_work_set .empty ()) {
2893
- const uint256 orphanHash = *orphan_work_set .begin ();
2894
- orphan_work_set. erase (orphan_work_set .begin ());
2892
+ while (!peer. m_orphan_work_set .empty ()) {
2893
+ const uint256 orphanHash = *peer. m_orphan_work_set .begin ();
2894
+ peer. m_orphan_work_set . erase (peer. m_orphan_work_set .begin ());
2895
2895
2896
2896
const auto [porphanTx, from_peer] = m_orphanage.GetTx (orphanHash);
2897
2897
if (porphanTx == nullptr ) continue ;
@@ -2902,7 +2902,7 @@ void PeerManagerImpl::ProcessOrphanTx(std::set<uint256>& orphan_work_set)
2902
2902
if (result.m_result_type == MempoolAcceptResult::ResultType::VALID) {
2903
2903
LogPrint (BCLog::MEMPOOL, " accepted orphan tx %s\n " , orphanHash.ToString ());
2904
2904
RelayTransaction (orphanHash, porphanTx->GetWitnessHash ());
2905
- m_orphanage.AddChildrenToWorkSet (*porphanTx, orphan_work_set );
2905
+ m_orphanage.AddChildrenToWorkSet (*porphanTx, peer. m_orphan_work_set );
2906
2906
m_orphanage.EraseTx (orphanHash);
2907
2907
for (const CTransactionRef& removedTx : result.m_replaced_transactions .value ()) {
2908
2908
AddToCompactExtraTransactions (removedTx);
@@ -3959,7 +3959,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
3959
3959
}
3960
3960
3961
3961
// Recursively process any orphan transactions that depended on this one
3962
- ProcessOrphanTx (peer-> m_orphan_work_set );
3962
+ ProcessOrphanTx (* peer);
3963
3963
}
3964
3964
else if (state.GetResult () == TxValidationResult::TX_MISSING_INPUTS)
3965
3965
{
@@ -4771,7 +4771,7 @@ bool PeerManagerImpl::ProcessMessages(CNode* pfrom, std::atomic<bool>& interrupt
4771
4771
{
4772
4772
LOCK2 (cs_main, g_cs_orphans);
4773
4773
if (!peer->m_orphan_work_set .empty ()) {
4774
- ProcessOrphanTx (peer-> m_orphan_work_set );
4774
+ ProcessOrphanTx (* peer);
4775
4775
}
4776
4776
}
4777
4777
0 commit comments