aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2012-02-10 09:04:19 -0800
committerGavin Andresen <[email protected]>2012-02-10 09:04:19 -0800
commitb0cfef3214036bce18daf746b8ff228111e1fdfc (patch)
tree73fb54db58c992a4265c12664d2949a047c990c6 /src/main.cpp
parentUpdate readme-qt.rst for 0.6.0 (diff)
parentFix #794. Only remove transactions from memory pool when they're actually in... (diff)
downloaddiscoin-b0cfef3214036bce18daf746b8ff228111e1fdfc.tar.xz
discoin-b0cfef3214036bce18daf746b8ff228111e1fdfc.zip
Merge pull request #813 from dooglus/master
Fix #794. Only remove transactions from memory pool when they're actually in the memory pool.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp
index f78133b53..e4c6714ea 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -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;
}