Browse Source

Fix #794. Only remove transactions from memory pool when they're actually in the memory pool.

miguelfreitas
Chris Moore 13 years ago
parent
commit
74f28bf1fd
  1. 6
      src/main.cpp

6
src/main.cpp

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

Loading…
Cancel
Save