Allow moving CTxMemPoolEntry objects, disallow copying
This commit is contained in:
1 parent
6c73e47448
commit
92b0079fe3
2 files changed
+3
-9
No files matched your search
@@ -71,10 +71,7 @@ public:
|
|||||||
typedef std::set<CTxMemPoolEntryRef, CompareIteratorByHash> Children;
|
typedef std::set<CTxMemPoolEntryRef, CompareIteratorByHash> Children;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CTxMemPoolEntry(const CTxMemPoolEntry&) = default;
|
CTxMemPoolEntry(const CTxMemPoolEntry&) = delete;
|
||||||
struct ExplicitCopyTag {
|
|
||||||
explicit ExplicitCopyTag() = default;
|
|
||||||
};
|
|
||||||
|
|
||||||
const CTransactionRef tx;
|
const CTransactionRef tx;
|
||||||
mutable Parents m_parents;
|
mutable Parents m_parents;
|
||||||
@@ -127,13 +124,10 @@ public:
|
|||||||
nModFeesWithAncestors{nFee},
|
nModFeesWithAncestors{nFee},
|
||||||
nSigOpCostWithAncestors{sigOpCost} {}
|
nSigOpCostWithAncestors{sigOpCost} {}
|
||||||
|
|
||||||
CTxMemPoolEntry(ExplicitCopyTag, const CTxMemPoolEntry& entry) : CTxMemPoolEntry(entry) {}
|
|
||||||
CTxMemPoolEntry& operator=(const CTxMemPoolEntry&) = delete;
|
CTxMemPoolEntry& operator=(const CTxMemPoolEntry&) = delete;
|
||||||
CTxMemPoolEntry(CTxMemPoolEntry&&) = delete;
|
CTxMemPoolEntry(CTxMemPoolEntry&&) = default;
|
||||||
CTxMemPoolEntry& operator=(CTxMemPoolEntry&&) = delete;
|
CTxMemPoolEntry& operator=(CTxMemPoolEntry&&) = delete;
|
||||||
|
|
||||||
static constexpr ExplicitCopyTag ExplicitCopy{};
|
|
||||||
|
|
||||||
const CTransaction& GetTx() const { return *this->tx; }
|
const CTransaction& GetTx() const { return *this->tx; }
|
||||||
CTransactionRef GetSharedTx() const { return this->tx; }
|
CTransactionRef GetSharedTx() const { return this->tx; }
|
||||||
const CAmount& GetFee() const { return nFee; }
|
const CAmount& GetFee() const { return nFee; }
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ FUZZ_TARGET(policy_estimator, .init = initialize_policy_estimator)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
const CTransaction tx{*mtx};
|
const CTransaction tx{*mtx};
|
||||||
mempool_entries.emplace_back(CTxMemPoolEntry::ExplicitCopy, ConsumeTxMemPoolEntry(fuzzed_data_provider, tx, current_height));
|
mempool_entries.push_back(ConsumeTxMemPoolEntry(fuzzed_data_provider, tx, current_height));
|
||||||
}
|
}
|
||||||
std::vector<RemovedMempoolTransactionInfo> txs;
|
std::vector<RemovedMempoolTransactionInfo> txs;
|
||||||
txs.reserve(mempool_entries.size());
|
txs.reserve(mempool_entries.size());
|
||||||
|
|||||||
Reference in new issue
Block a user