Replace CCoins-based CTxMemPool::pruneSpent with isSpent

This commit is contained in:
Pieter Wuille
2017-04-25 11:29:37 -07:00
parent 05293f3cb7
commit 13870b56fc
4 changed files with 5 additions and 14 deletions

View File

@@ -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