mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-20 11:49:07 +02:00
Remove member variable hadNoDependencies from CTxMemPoolEntry
Fee estimation can just check its own mapMemPoolTxs to determine the same information. Note that now fee estimation for block processing must happen before those transactions are removed, but this shoudl be a speedup.
This commit is contained in:
@@ -327,13 +327,6 @@ void CBlockPolicyEstimator::processTransaction(const CTxMemPoolEntry& entry, boo
|
||||
if (!fCurrentEstimate)
|
||||
return;
|
||||
|
||||
if (!entry.WasClearAtEntry()) {
|
||||
// This transaction depends on other transactions in the mempool to
|
||||
// be included in a block before it will be able to be included, so
|
||||
// we shouldn't include it in our calculations
|
||||
return;
|
||||
}
|
||||
|
||||
// Feerates are stored and reported as BTC-per-kb:
|
||||
CFeeRate feeRate(entry.GetFee(), entry.GetTxSize());
|
||||
|
||||
@@ -343,10 +336,8 @@ void CBlockPolicyEstimator::processTransaction(const CTxMemPoolEntry& entry, boo
|
||||
|
||||
void CBlockPolicyEstimator::processBlockTx(unsigned int nBlockHeight, const CTxMemPoolEntry& entry)
|
||||
{
|
||||
if (!entry.WasClearAtEntry()) {
|
||||
// This transaction depended on other transactions in the mempool to
|
||||
// be included in a block before it was able to be included, so
|
||||
// we shouldn't include it in our calculations
|
||||
if (!removeTx(entry.GetTx().GetHash())) {
|
||||
// This transaction wasn't being tracked for fee estimation
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -378,14 +369,18 @@ void CBlockPolicyEstimator::processBlock(unsigned int nBlockHeight,
|
||||
// transaction fees."
|
||||
return;
|
||||
}
|
||||
nBestSeenHeight = nBlockHeight;
|
||||
|
||||
// Only want to be updating estimates when our blockchain is synced,
|
||||
// otherwise we'll miscalculate how many blocks its taking to get included.
|
||||
if (!fCurrentEstimate)
|
||||
return;
|
||||
|
||||
// Clear the current block state
|
||||
// Must update nBestSeenHeight in sync with ClearCurrent so that
|
||||
// calls to removeTx (via processBlockTx) correctly calculate age
|
||||
// of unconfirmed txs to remove from tracking.
|
||||
nBestSeenHeight = nBlockHeight;
|
||||
|
||||
// Clear the current block state and update unconfirmed circular buffer
|
||||
feeStats.ClearCurrent(nBlockHeight);
|
||||
|
||||
// Repopulate the current block states
|
||||
|
||||
Reference in New Issue
Block a user