Browse Source

Don't try to verify a non-existent wallet.dat

miguelfreitas
Gavin Andresen 12 years ago
parent
commit
d0b3e77a08
  1. 23
      src/init.cpp

23
src/init.cpp

@ -507,17 +507,20 @@ bool AppInit2()
return false; return false;
} }
CDBEnv::VerifyResult r = bitdb.Verify("wallet.dat", CWalletDB::Recover); if (filesystem::exists(GetDataDir() / "wallet.dat"))
if (r == CDBEnv::RECOVER_OK)
{ {
string msg = strprintf(_("Warning: wallet.dat corrupt, data salvaged!" CDBEnv::VerifyResult r = bitdb.Verify("wallet.dat", CWalletDB::Recover);
" Original wallet.dat saved as wallet.{timestamp}.bak in %s; if" if (r == CDBEnv::RECOVER_OK)
" your balance or transactions are incorrect you should" {
" restore from a backup."), pszDataDir); string msg = strprintf(_("Warning: wallet.dat corrupt, data salvaged!"
uiInterface.ThreadSafeMessageBox(msg, _("Bitcoin"), CClientUIInterface::OK | CClientUIInterface::ICON_EXCLAMATION | CClientUIInterface::MODAL); " Original wallet.dat saved as wallet.{timestamp}.bak in %s; if"
} " your balance or transactions are incorrect you should"
if (r == CDBEnv::RECOVER_FAIL) " restore from a backup."), pszDataDir);
return InitError(_("wallet.dat corrupt, salvage failed")); uiInterface.ThreadSafeMessageBox(msg, _("Bitcoin"), CClientUIInterface::OK | CClientUIInterface::ICON_EXCLAMATION | CClientUIInterface::MODAL);
}
if (r == CDBEnv::RECOVER_FAIL)
return InitError(_("wallet.dat corrupt, salvage failed"));
}
// ********************************************************* Step 6: network initialization // ********************************************************* Step 6: network initialization

Loading…
Cancel
Save