aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.cpp
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2016-11-11 11:57:51 -0500
committerAlex Morcos <morcos@chaincode.com>2017-01-04 12:09:33 -0500
commit84f7ab08d2e8e83a584d72fdf44f68b34baf8165 (patch)
treef5076b10d4afd783a5fb77f3a19aff1dab1fd9dd /src/txmempool.cpp
parent60ac00de854981333656d17c9b2ea2efd1efc436 (diff)
downloadbitcoin-84f7ab08d2e8e83a584d72fdf44f68b34baf8165.tar.xz
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.
Diffstat (limited to 'src/txmempool.cpp')
-rw-r--r--src/txmempool.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index 4ccbcadefc..57300bb51d 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -22,10 +22,10 @@ using namespace std;
CTxMemPoolEntry::CTxMemPoolEntry(const CTransactionRef& _tx, const CAmount& _nFee,
int64_t _nTime, double _entryPriority, unsigned int _entryHeight,
- bool poolHasNoInputsOf, CAmount _inChainInputValue,
+ CAmount _inChainInputValue,
bool _spendsCoinbase, int64_t _sigOpsCost, LockPoints lp):
tx(_tx), nFee(_nFee), nTime(_nTime), entryPriority(_entryPriority), entryHeight(_entryHeight),
- hadNoDependencies(poolHasNoInputsOf), inChainInputValue(_inChainInputValue),
+ inChainInputValue(_inChainInputValue),
spendsCoinbase(_spendsCoinbase), sigOpCost(_sigOpsCost), lockPoints(lp)
{
nTxWeight = GetTransactionWeight(*tx);
@@ -604,6 +604,8 @@ void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigne
if (i != mapTx.end())
entries.push_back(*i);
}
+ // Before the txs in the new block have been removed from the mempool, update policy estimates
+ minerPolicyEstimator->processBlock(nBlockHeight, entries, fCurrentEstimate);
for (const auto& tx : vtx)
{
txiter it = mapTx.find(tx->GetHash());
@@ -615,8 +617,6 @@ void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigne
removeConflicts(*tx);
ClearPrioritisation(tx->GetHash());
}
- // After the txs in the new block have been removed from the mempool, update policy estimates
- minerPolicyEstimator->processBlock(nBlockHeight, entries, fCurrentEstimate);
lastRollingFeeUpdate = GetTime();
blockSinceLastRollingFeeBump = true;
}