diff --git a/src/net_processing.h b/src/net_processing.h --- a/src/net_processing.h +++ b/src/net_processing.h @@ -152,6 +152,8 @@ */ bool MaybeDiscourageAndDisconnect(CNode &pnode); + void ProcessOrphanTx(const Config &config, std::set &orphan_work_set) + EXCLUSIVE_LOCKS_REQUIRED(cs_main, g_cs_orphans); /** Process a single headers message from a peer. */ void ProcessHeadersMessage(const Config &config, CNode &pfrom, const std::vector &headers, diff --git a/src/net_processing.cpp b/src/net_processing.cpp --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2343,9 +2343,8 @@ } } -void static ProcessOrphanTx(const Config &config, CConnman &connman, - CTxMemPool &mempool, - std::set &orphan_work_set) +void PeerManager::ProcessOrphanTx(const Config &config, + std::set &orphan_work_set) EXCLUSIVE_LOCKS_REQUIRED(cs_main, g_cs_orphans) { AssertLockHeld(cs_main); AssertLockHeld(g_cs_orphans); @@ -2375,12 +2374,12 @@ continue; } - if (AcceptToMemoryPool(config, mempool, orphan_state, porphanTx, + if (AcceptToMemoryPool(config, m_mempool, orphan_state, porphanTx, false /* bypass_limits */, Amount::zero() /* nAbsurdFee */)) { LogPrint(BCLog::MEMPOOL, " accepted orphan tx %s\n", orphanTxId.ToString()); - RelayTransaction(orphanTxId, connman); + RelayTransaction(orphanTxId, m_connman); for (size_t i = 0; i < orphanTx.vout.size(); i++) { auto it_by_prev = mapOrphanTransactionsByPrev.find(COutPoint(orphanTxId, i)); @@ -2411,7 +2410,7 @@ EraseOrphanTx(orphanTxId); done = true; } - mempool.check(&::ChainstateActive().CoinsTip()); + m_mempool.check(&::ChainstateActive().CoinsTip()); } } @@ -3384,8 +3383,7 @@ // Recursively process any orphan transactions that depended on this // one - ProcessOrphanTx(config, m_connman, m_mempool, - pfrom.orphan_work_set); + ProcessOrphanTx(config, pfrom.orphan_work_set); } else if (state.GetResult() == TxValidationResult::TX_MISSING_INPUTS) { // It may be the case that the orphans parents have all been // rejected. @@ -4465,7 +4463,7 @@ if (!pfrom->orphan_work_set.empty()) { LOCK2(cs_main, g_cs_orphans); - ProcessOrphanTx(config, m_connman, m_mempool, pfrom->orphan_work_set); + ProcessOrphanTx(config, pfrom->orphan_work_set); } if (pfrom->fDisconnect) {