Skip to content

Commit

Permalink
doc: Document CTxMemPoolEntry copy and move constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCharlatan committed Feb 10, 2024
1 parent a54c764 commit c34dcea
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/kernel/mempool_entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,11 @@ class CTxMemPoolEntry
nModFeesWithAncestors{nFee},
nSigOpCostWithAncestors{sigOpCost} {}

// Prohibit accidental copies that might invalidate references from parent
// and child transactions, or lead to unsafe usage of mapTx.iterator_to.
CTxMemPoolEntry(ExplicitCopyTag, const CTxMemPoolEntry& entry) : CTxMemPoolEntry(entry) {}
CTxMemPoolEntry& operator=(const CTxMemPoolEntry&) = delete;
// The move constructor is already implicitly deleted, so be explicit about it.
CTxMemPoolEntry(CTxMemPoolEntry&&) = delete;
CTxMemPoolEntry& operator=(CTxMemPoolEntry&&) = delete;

Expand Down

0 comments on commit c34dcea

Please sign in to comment.