Implement transaction expiry for Overwinter
This commit is contained in:
@@ -256,6 +256,24 @@ void CTxMemPool::removeConflicts(const CTransaction &tx, std::list<CTransaction>
|
||||
}
|
||||
}
|
||||
|
||||
void CTxMemPool::removeExpired(unsigned int nBlockHeight)
|
||||
{
|
||||
// Remove expired txs from the mempool
|
||||
LOCK(cs);
|
||||
list<CTransaction> transactionsToRemove;
|
||||
for (indexed_transaction_set::const_iterator it = mapTx.begin(); it != mapTx.end(); it++)
|
||||
{
|
||||
const CTransaction& tx = it->GetTx();
|
||||
if (IsExpiredTx(tx, nBlockHeight)) {
|
||||
transactionsToRemove.push_back(tx);
|
||||
}
|
||||
}
|
||||
for (const CTransaction& tx : transactionsToRemove) {
|
||||
list<CTransaction> removed;
|
||||
remove(tx, removed, true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a block is connected. Removes from mempool and updates the miner fee estimator.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user