diff --git a/src/net_processing.cpp b/src/net_processing.cpp index e0af64376b..e5fad5fe61 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -872,7 +872,7 @@ private: * million to make it highly unlikely for users to have issues with this * filter. * - * Memory used: 1.3MB + * Memory used: 1.3 MB */ CRollingBloomFilter m_recent_rejects GUARDED_BY(::cs_main){120'000, 0.000'001}; uint256 hashRecentRejectsChainTip GUARDED_BY(cs_main); @@ -1620,6 +1620,7 @@ void PeerManagerImpl::FinalizeNode(const CNode& node) { assert(m_num_preferred_download_peers == 0); assert(m_peers_downloading_from == 0); assert(m_outbound_peers_with_protect_from_disconnect == 0); + assert(m_orphanage.Size() == 0); } } // cs_main diff --git a/src/txorphanage.h b/src/txorphanage.h index d8ef7a5c44..d3d06c8e53 100644 --- a/src/txorphanage.h +++ b/src/txorphanage.h @@ -50,6 +50,13 @@ public: * (ie orphans that may have found their final missing parent, and so should be reconsidered for the mempool) */ void AddChildrenToWorkSet(const CTransaction& tx, std::set& orphan_work_set) const EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans); + /** Return how many entries exist in the orphange */ + size_t Size() LOCKS_EXCLUDED(::g_cs_orphans) + { + LOCK(::g_cs_orphans); + return m_orphans.size(); + } + protected: struct OrphanTx { CTransactionRef tx; diff --git a/test/functional/p2p_permissions.py b/test/functional/p2p_permissions.py index e7e82eccb5..71ebfd38f9 100755 --- a/test/functional/p2p_permissions.py +++ b/test/functional/p2p_permissions.py @@ -133,7 +133,7 @@ class P2PPermissionsTests(BitcoinTestFramework): tx.vout[0].nValue += 1 txid = tx.rehash() # Send the transaction twice. The first time, it'll be rejected by ATMP because it conflicts - # with a mempool transaction. The second time, it'll be in the recentRejects filter. + # with a mempool transaction. The second time, it'll be in the m_recent_rejects filter. p2p_rebroadcast_wallet.send_txs_and_test( [tx], self.nodes[1],