Skip to content

Commit 7882748

Browse files
committed
doc: Document CTxMemPoolEntry copy and move constructors
1 parent 755b7d8 commit 7882748

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/kernel/mempool_entry.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,11 @@ class CTxMemPoolEntry
127127
nModFeesWithAncestors{nFee},
128128
nSigOpCostWithAncestors{sigOpCost} {}
129129

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

0 commit comments

Comments
 (0)