Fix crashing bug caused by orphan(s) with duplicate prevout.hash

Rebased-From: def2fdb
Rebased-By: Wladimir J. van der Laan
This commit is contained in:
Gavin Andresen
2014-09-09 14:01:11 -04:00
committed by Wladimir J. van der Laan
parent c6727f34d1
commit 12927dd315

View File

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