diff --git a/src/txorphanage.h b/src/txorphanage.h --- a/src/txorphanage.h +++ b/src/txorphanage.h @@ -13,7 +13,12 @@ /** 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: /** Add a new orphan transaction */ @@ -24,7 +29,8 @@ bool HaveTx(const TxId &txid) const LOCKS_EXCLUDED(g_cs_orphans); /** - * Get the details of an orphan transaction (returns nullptr if not found) + * Get an orphan transaction and its originating peer + * (Transaction ref will be nullptr if not found) */ std::pair GetTx(const TxId &txid) const EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans); @@ -37,7 +43,7 @@ */ 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) LOCKS_EXCLUDED(g_cs_orphans); /** Limit the orphanage to the given maximum */