Invoke TxGraph::DoWork() at appropriate times
This commit is contained in:
1 parent
6c5c44f774
commit
9567eaa66d
2 files changed
+7
No files matched your search
@@ -211,6 +211,7 @@ void CTxMemPool::Apply(ChangeSet* changeset)
|
|||||||
|
|
||||||
addNewTransaction(it);
|
addNewTransaction(it);
|
||||||
}
|
}
|
||||||
|
m_txgraph->DoWork(POST_CHANGE_WORK);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTxMemPool::addNewTransaction(CTxMemPool::txiter newit)
|
void CTxMemPool::addNewTransaction(CTxMemPool::txiter newit)
|
||||||
@@ -357,6 +358,7 @@ void CTxMemPool::removeForReorg(CChain& chain, std::function<bool(txiter)> check
|
|||||||
for (indexed_transaction_set::const_iterator it = mapTx.begin(); it != mapTx.end(); it++) {
|
for (indexed_transaction_set::const_iterator it = mapTx.begin(); it != mapTx.end(); it++) {
|
||||||
assert(TestLockPointValidity(chain, it->GetLockPoints()));
|
assert(TestLockPointValidity(chain, it->GetLockPoints()));
|
||||||
}
|
}
|
||||||
|
m_txgraph->DoWork(POST_CHANGE_WORK);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTxMemPool::removeConflicts(const CTransaction &tx)
|
void CTxMemPool::removeConflicts(const CTransaction &tx)
|
||||||
@@ -401,6 +403,7 @@ void CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigne
|
|||||||
}
|
}
|
||||||
lastRollingFeeUpdate = GetTime();
|
lastRollingFeeUpdate = GetTime();
|
||||||
blockSinceLastRollingFeeBump = true;
|
blockSinceLastRollingFeeBump = true;
|
||||||
|
m_txgraph->DoWork(POST_CHANGE_WORK);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTxMemPool::check(const CCoinsViewCache& active_coins_tip, int64_t spendheight) const
|
void CTxMemPool::check(const CCoinsViewCache& active_coins_tip, int64_t spendheight) const
|
||||||
|
|||||||
@@ -55,6 +55,10 @@ static const uint32_t MEMPOOL_HEIGHT = 0x7FFFFFFF;
|
|||||||
* iterations. */
|
* iterations. */
|
||||||
static constexpr uint64_t ACCEPTABLE_ITERS = 1'700;
|
static constexpr uint64_t ACCEPTABLE_ITERS = 1'700;
|
||||||
|
|
||||||
|
/** How much work we ask TxGraph to do after a mempool change occurs (either
|
||||||
|
* due to a changeset being applied, a new block being found, or a reorg). */
|
||||||
|
static constexpr uint64_t POST_CHANGE_WORK = 5 * ACCEPTABLE_ITERS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test whether the LockPoints height and time are still valid on the current chain
|
* Test whether the LockPoints height and time are still valid on the current chain
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in new issue
Block a user