aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2014-09-09 14:01:11 -0400
committerWladimir J. van der Laan <laanwj@gmail.com>2014-09-10 16:56:54 +0200
commit12927dd315e22b2cc0caa02e9f355c807ea7326a (patch)
treeceee7dd0aefd20343d6c5a8f0187f2cfb5954f04
parentc6727f34d16e726ef06dcd7ec8b814f7e986aec4 (diff)
downloadbitcoin-12927dd315e22b2cc0caa02e9f355c807ea7326a.tar.xz
Fix crashing bug caused by orphan(s) with duplicate prevout.hash
Rebased-From: def2fdb Rebased-By: Wladimir J. van der Laan
-rw-r--r--src/main.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 8cae23a139..07b20906f5 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -443,6 +443,8 @@ void static EraseOrphanTx(uint256 hash)
BOOST_FOREACH(const CTxIn& txin, it->second.vin)
{
map<uint256, set<uint256> >::iterator itPrev = mapOrphanTransactionsByPrev.find(txin.prevout.hash);
+ if (itPrev == mapOrphanTransactionsByPrev.end())
+ continue;
itPrev->second.erase(hash);
if (itPrev->second.empty())
mapOrphanTransactionsByPrev.erase(itPrev);