[cleanup] replace TxOrphanage::Size() with CountUniqueOrphans

This commit is contained in:
glozow
2025-06-05 14:13:28 -04:00
parent ed24e01696
commit cc50f2f0df
4 changed files with 15 additions and 19 deletions

View File

@@ -572,7 +572,7 @@ void TxDownloadManagerImpl::CheckIsEmpty(NodeId nodeid)
void TxDownloadManagerImpl::CheckIsEmpty()
{
assert(m_orphanage->TotalOrphanUsage() == 0);
assert(m_orphanage->Size() == 0);
assert(m_orphanage->CountUniqueOrphans() == 0);
assert(m_txrequest.Size() == 0);
assert(m_num_wtxid_peers == 0);
}

View File

@@ -229,7 +229,6 @@ public:
std::vector<std::pair<Wtxid, NodeId>> AddChildrenToWorkSet(const CTransaction& tx, FastRandomContext& rng) override;
bool HaveTxToReconsider(NodeId peer) override;
std::vector<CTransactionRef> GetChildrenFromSamePeer(const CTransactionRef& parent, NodeId nodeid) const override;
size_t Size() const override { return m_unique_orphans; }
std::vector<OrphanTxBase> GetOrphanTransactions() const override;
TxOrphanage::Usage TotalOrphanUsage() const override;
void SanityCheck() const override;

View File

@@ -98,9 +98,6 @@ public:
* recent to least recent. */
virtual std::vector<CTransactionRef> GetChildrenFromSamePeer(const CTransactionRef& parent, NodeId nodeid) const = 0;
/** Return how many entries exist in the orphange */
virtual size_t Size() const = 0;
/** Get all orphan transactions */
virtual std::vector<OrphanTxBase> GetOrphanTransactions() const = 0;