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