[net processing] Add Orphanage empty consistency check
When removing the final peer, assert that m_tx_orphanage is empty.
This commit is contained in:
1 parent
201c5e4aec
commit
9190b01d8d
2 files changed
+8
No files matched your search
@@ -1194,6 +1194,7 @@ void PeerManagerImpl::FinalizeNode(const CNode& node)
|
|||||||
assert(m_outbound_peers_with_protect_from_disconnect == 0);
|
assert(m_outbound_peers_with_protect_from_disconnect == 0);
|
||||||
assert(m_wtxid_relay_peers == 0);
|
assert(m_wtxid_relay_peers == 0);
|
||||||
assert(m_txrequest.Size() == 0);
|
assert(m_txrequest.Size() == 0);
|
||||||
|
assert(m_orphanage.Size() == 0);
|
||||||
}
|
}
|
||||||
} // cs_main
|
} // cs_main
|
||||||
if (node.fSuccessfullyConnected && misbehavior == 0 &&
|
if (node.fSuccessfullyConnected && misbehavior == 0 &&
|
||||||
|
|||||||
@@ -47,6 +47,13 @@ public:
|
|||||||
* (ie orphans that may have found their final missing parent, and so should be reconsidered for the mempool) */
|
* (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<uint256>& orphan_work_set) const EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans);
|
void AddChildrenToWorkSet(const CTransaction& tx, std::set<uint256>& 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:
|
protected:
|
||||||
struct OrphanTx {
|
struct OrphanTx {
|
||||||
CTransactionRef tx;
|
CTransactionRef tx;
|
||||||
|
|||||||
Reference in new issue
Block a user