Merge pull request #813 from dooglus/master

Fix #794. Only remove transactions from memory pool when they're actually in the memory pool.
pull/2/merge
Gavin Andresen 13 years ago
commit b0cfef3214

@ -618,11 +618,15 @@ bool CTransaction::RemoveFromMemoryPool()
// Remove transaction from memory pool
CRITICAL_BLOCK(cs_mapTransactions)
{
BOOST_FOREACH(const CTxIn& txin, vin)
mapNextTx.erase(txin.prevout);
mapTransactions.erase(GetHash());
nTransactionsUpdated++;
--nPooledTx;
uint256 hash = GetHash();
if (mapTransactions.count(hash))
{
BOOST_FOREACH(const CTxIn& txin, vin)
mapNextTx.erase(txin.prevout);
mapTransactions.erase(hash);
nTransactionsUpdated++;
--nPooledTx;
}
}
return true;
}

Loading…
Cancel
Save