mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Replace CCoins-based CTxMemPool::pruneSpent with isSpent
This commit is contained in:
@@ -343,17 +343,10 @@ CTxMemPool::CTxMemPool(CBlockPolicyEstimator* estimator) :
|
||||
nCheckFrequency = 0;
|
||||
}
|
||||
|
||||
void CTxMemPool::pruneSpent(const uint256 &hashTx, CCoins &coins)
|
||||
bool CTxMemPool::isSpent(const COutPoint& outpoint)
|
||||
{
|
||||
LOCK(cs);
|
||||
|
||||
auto it = mapNextTx.lower_bound(COutPoint(hashTx, 0));
|
||||
|
||||
// iterate over all COutPoints in mapNextTx whose hash equals the provided hashTx
|
||||
while (it != mapNextTx.end() && it->first->hash == hashTx) {
|
||||
coins.Spend(it->first->n); // and remove those outputs from coins
|
||||
it++;
|
||||
}
|
||||
return mapNextTx.count(outpoint);
|
||||
}
|
||||
|
||||
unsigned int CTxMemPool::GetTransactionsUpdated() const
|
||||
|
||||
Reference in New Issue
Block a user