aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/mempool_entry.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/mempool_entry.h')
-rw-r--r--src/kernel/mempool_entry.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/kernel/mempool_entry.h b/src/kernel/mempool_entry.h
index 7c905ca4f4..b5c0499012 100644
--- a/src/kernel/mempool_entry.h
+++ b/src/kernel/mempool_entry.h
@@ -71,6 +71,11 @@ public:
typedef std::set<CTxMemPoolEntryRef, CompareIteratorByHash> Children;
private:
+ CTxMemPoolEntry(const CTxMemPoolEntry&) = default;
+ struct ExplicitCopyTag {
+ explicit ExplicitCopyTag() = default;
+ };
+
const CTransactionRef tx;
mutable Parents m_parents;
mutable Children m_children;
@@ -122,6 +127,13 @@ public:
nModFeesWithAncestors{nFee},
nSigOpCostWithAncestors{sigOpCost} {}
+ CTxMemPoolEntry(ExplicitCopyTag, const CTxMemPoolEntry& entry) : CTxMemPoolEntry(entry) {}
+ CTxMemPoolEntry& operator=(const CTxMemPoolEntry&) = delete;
+ CTxMemPoolEntry(CTxMemPoolEntry&&) = delete;
+ CTxMemPoolEntry& operator=(CTxMemPoolEntry&&) = delete;
+
+ static constexpr ExplicitCopyTag ExplicitCopy{};
+
const CTransaction& GetTx() const { return *this->tx; }
CTransactionRef GetSharedTx() const { return this->tx; }
const CAmount& GetFee() const { return nFee; }