diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index f4fc96f46..43b115c49 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -806,8 +806,19 @@ void BlockChain::rescue(OverlayDB& _db) cout << "Rescuing database..." << endl; unsigned u = 1; - while (isKnown(numberHash(u))) - u *= 2; + while (true) + { + try { + if (isKnown(numberHash(u))) + u *= 2; + else + break; + } + catch (...) + { + break; + } + } unsigned l = u / 2; cout << "Finding last likely block number..." << endl; while (u - l > 1)