From 5e50e2d1b95e7ca7709a9671ab21f1164b8d0cb8 Mon Sep 17 00:00:00 2001 From: Anthony Towns Date: Tue, 2 Mar 2021 19:36:48 +1000 Subject: txorphanage: comment improvements --- src/txorphanage.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/txorphanage.h') diff --git a/src/txorphanage.h b/src/txorphanage.h index a5e6764d75..df55cdb3be 100644 --- a/src/txorphanage.h +++ b/src/txorphanage.h @@ -13,7 +13,10 @@ /** Guards orphan transactions and extra txs for compact blocks */ extern RecursiveMutex g_cs_orphans; -/** Data structure to keep track of orphan transactions +/** A class to track orphan transactions (failed on TX_MISSING_INPUTS) + * Since we cannot distinguish orphans from bad transactions with + * non-existent inputs, we heavily limit the number of orphans + * we keep and the duration we keep them for. */ class TxOrphanage { public: @@ -23,7 +26,9 @@ public: /** Check if we already have an orphan transaction (by txid or wtxid) */ bool HaveTx(const GenTxid& gtxid) const EXCLUSIVE_LOCKS_REQUIRED(!g_cs_orphans); - /** Get the details of an orphan transaction (returns nullptr if not found) */ + /** Get an orphan transaction and its orginating peer + * (Transaction ref will be nullptr if not found) + */ std::pair GetTx(const uint256& txid) const EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans); /** Erase an orphan by txid */ @@ -32,7 +37,7 @@ public: /** Erase all orphans announced by a peer (eg, after that peer disconnects) */ void EraseForPeer(NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans); - /** Erase all orphans included in / invalidated by a new block */ + /** Erase all orphans included in or invalidated by a new block */ void EraseForBlock(const CBlock& block) EXCLUSIVE_LOCKS_REQUIRED(!g_cs_orphans); /** Limit the orphanage to the given maximum */ -- cgit v1.2.3