Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F10615269
D9044.id27269.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D9044.id27269.diff
View Options
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<TxId> &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<CBlockHeader> &headers,
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -2341,9 +2341,8 @@
}
}
-void static ProcessOrphanTx(const Config &config, CConnman &connman,
- CTxMemPool &mempool,
- std::set<TxId> &orphan_work_set)
+void PeerManager::ProcessOrphanTx(const Config &config,
+ std::set<TxId> &orphan_work_set)
EXCLUSIVE_LOCKS_REQUIRED(cs_main, g_cs_orphans) {
AssertLockHeld(cs_main);
AssertLockHeld(g_cs_orphans);
@@ -2373,12 +2372,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));
@@ -2409,7 +2408,7 @@
EraseOrphanTx(orphanTxId);
done = true;
}
- mempool.check(&::ChainstateActive().CoinsTip());
+ m_mempool.check(&::ChainstateActive().CoinsTip());
}
}
@@ -3382,8 +3381,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.
@@ -4463,7 +4461,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) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 10:03 (16 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4559227
Default Alt Text
D9044.id27269.diff (2 KB)
Attached To
D9044: [net processing] Move ProcessOrphanTx to PeerManager
Event Timeline
Log In to Comment