@@ -22,11 +22,11 @@ class TxOrphanageImpl final : public TxOrphanage {
22
22
};
23
23
24
24
/* * Total usage (weight) of all entries in m_orphans. */
25
- int64_t m_total_orphan_usage{0 };
25
+ TxOrphanage::Usage m_total_orphan_usage{0 };
26
26
27
27
/* * Total number of <peer, tx> pairs. Can be larger than m_orphans.size() because multiple peers
28
28
* may have announced the same orphan. */
29
- unsigned int m_total_announcements{0 };
29
+ TxOrphanage::Count m_total_announcements{0 };
30
30
31
31
/* * Map from wtxid to orphan transaction record. Limited by
32
32
* DEFAULT_MAX_ORPHAN_TRANSACTIONS */
@@ -44,7 +44,7 @@ class TxOrphanageImpl final : public TxOrphanage {
44
44
* PeerOrphanInfo, so the total of all peers' m_total_usage may be larger than
45
45
* m_total_orphan_size. If a peer is removed as an announcer, even if the orphan still
46
46
* remains in the orphanage, this number will be decremented. */
47
- int64_t m_total_usage{0 };
47
+ TxOrphanage::Usage m_total_usage{0 };
48
48
};
49
49
std::map<NodeId, PeerOrphanInfo> m_peer_orphanage_info;
50
50
@@ -85,8 +85,8 @@ class TxOrphanageImpl final : public TxOrphanage {
85
85
std::vector<CTransactionRef> GetChildrenFromSamePeer (const CTransactionRef& parent, NodeId nodeid) const override ;
86
86
size_t Size () const override { return m_orphans.size (); }
87
87
std::vector<OrphanTxBase> GetOrphanTransactions () const override ;
88
- int64_t TotalOrphanUsage () const override { return m_total_orphan_usage; }
89
- int64_t UsageByPeer (NodeId peer) const override ;
88
+ TxOrphanage::Usage TotalOrphanUsage () const override { return m_total_orphan_usage; }
89
+ TxOrphanage::Usage UsageByPeer (NodeId peer) const override ;
90
90
void SanityCheck () const override ;
91
91
};
92
92
@@ -401,7 +401,7 @@ std::vector<TxOrphanage::OrphanTxBase> TxOrphanageImpl::GetOrphanTransactions()
401
401
return ret;
402
402
}
403
403
404
- int64_t TxOrphanageImpl::UsageByPeer (NodeId peer) const
404
+ TxOrphanage::Usage TxOrphanageImpl::UsageByPeer (NodeId peer) const
405
405
{
406
406
auto peer_it = m_peer_orphanage_info.find (peer);
407
407
return peer_it == m_peer_orphanage_info.end () ? 0 : peer_it->second .m_total_usage ;
@@ -410,12 +410,12 @@ int64_t TxOrphanageImpl::UsageByPeer(NodeId peer) const
410
410
void TxOrphanageImpl::SanityCheck () const
411
411
{
412
412
// Check that cached m_total_announcements is correct
413
- unsigned int counted_total_announcements{0 };
413
+ TxOrphanage::Count counted_total_announcements{0 };
414
414
// Check that m_total_orphan_usage is correct
415
- int64_t counted_total_usage{0 };
415
+ TxOrphanage::Usage counted_total_usage{0 };
416
416
417
417
// Check that cached PeerOrphanInfo::m_total_size is correct
418
- std::map<NodeId, int64_t > counted_size_per_peer;
418
+ std::map<NodeId, TxOrphanage::Usage > counted_size_per_peer;
419
419
420
420
for (const auto & [wtxid, orphan] : m_orphans) {
421
421
counted_total_announcements += orphan.announcers .size ();
0 commit comments