mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-13 06:03:54 +01:00
refactor: Move CTxMemPoolEntry class to its own module
This change nukes the policy/fees->mempool circular dependency. Easy to review using `diff --color-moved=dimmed-zebra`.
This commit is contained in:
@@ -41,42 +41,6 @@ bool TestLockPointValidity(CChain& active_chain, const LockPoints& lp)
|
||||
return true;
|
||||
}
|
||||
|
||||
CTxMemPoolEntry::CTxMemPoolEntry(const CTransactionRef& tx, CAmount fee,
|
||||
int64_t time, unsigned int entry_height,
|
||||
bool spends_coinbase, int64_t sigops_cost, LockPoints lp)
|
||||
: tx{tx},
|
||||
nFee{fee},
|
||||
nTxWeight(GetTransactionWeight(*tx)),
|
||||
nUsageSize{RecursiveDynamicUsage(tx)},
|
||||
nTime{time},
|
||||
entryHeight{entry_height},
|
||||
spendsCoinbase{spends_coinbase},
|
||||
sigOpCost{sigops_cost},
|
||||
m_modified_fee{nFee},
|
||||
lockPoints{lp},
|
||||
nSizeWithDescendants{GetTxSize()},
|
||||
nModFeesWithDescendants{nFee},
|
||||
nSizeWithAncestors{GetTxSize()},
|
||||
nModFeesWithAncestors{nFee},
|
||||
nSigOpCostWithAncestors{sigOpCost} {}
|
||||
|
||||
void CTxMemPoolEntry::UpdateModifiedFee(CAmount fee_diff)
|
||||
{
|
||||
nModFeesWithDescendants = SaturatingAdd(nModFeesWithDescendants, fee_diff);
|
||||
nModFeesWithAncestors = SaturatingAdd(nModFeesWithAncestors, fee_diff);
|
||||
m_modified_fee = SaturatingAdd(m_modified_fee, fee_diff);
|
||||
}
|
||||
|
||||
void CTxMemPoolEntry::UpdateLockPoints(const LockPoints& lp)
|
||||
{
|
||||
lockPoints = lp;
|
||||
}
|
||||
|
||||
size_t CTxMemPoolEntry::GetTxSize() const
|
||||
{
|
||||
return GetVirtualTransactionSize(nTxWeight, sigOpCost, ::nBytesPerSigOp);
|
||||
}
|
||||
|
||||
void CTxMemPool::UpdateForDescendants(txiter updateIt, cacheMap& cachedDescendants,
|
||||
const std::set<uint256>& setExclude, std::set<uint256>& descendants_to_remove)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user