diff --git a/src/main.cpp b/src/main.cpp index f063a48fe..27100d62c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -498,6 +498,8 @@ void static EraseOrphanTx(uint256 hash) BOOST_FOREACH(const CTxIn& txin, it->second.vin) { map >::iterator itPrev = mapOrphanTransactionsByPrev.find(txin.prevout.hash); + if (itPrev == mapOrphanTransactionsByPrev.end()) + continue; itPrev->second.erase(hash); if (itPrev->second.empty()) mapOrphanTransactionsByPrev.erase(itPrev);