aboutsummaryrefslogtreecommitdiff
path: root/src/txorphanage.h
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2021-03-02 19:36:48 +1000
committerAnthony Towns <aj@erisian.com.au>2021-03-02 19:40:11 +1000
commit5e50e2d1b95e7ca7709a9671ab21f1164b8d0cb8 (patch)
tree987034c53f4e886aa5e48d4123b1d07b61a87397 /src/txorphanage.h
parenteeeafb324ef6057f40b5c5fdd8464110e809b0f7 (diff)
downloadbitcoin-5e50e2d1b95e7ca7709a9671ab21f1164b8d0cb8.tar.xz
txorphanage: comment improvements
Diffstat (limited to 'src/txorphanage.h')
-rw-r--r--src/txorphanage.h11
1 files changed, 8 insertions, 3 deletions
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<CTransactionRef, NodeId> 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 */