mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
Merge pull request #2410 from gmaxwell/salvageharder
Make explicitly requested salvage operations keep going when there is an error.
This commit is contained in:
commit
e5ddaf5ec8
1 changed files with 11 additions and 2 deletions
13
src/db.cpp
13
src/db.cpp
|
@ -164,9 +164,18 @@ bool CDBEnv::Salvage(std::string strFile, bool fAggressive,
|
||||||
|
|
||||||
Db db(&dbenv, 0);
|
Db db(&dbenv, 0);
|
||||||
int result = db.verify(strFile.c_str(), NULL, &strDump, flags);
|
int result = db.verify(strFile.c_str(), NULL, &strDump, flags);
|
||||||
if (result != 0)
|
if (result == DB_VERIFY_BAD)
|
||||||
{
|
{
|
||||||
printf("ERROR: db salvage failed\n");
|
printf("Error: Salvage found errors, all data may not be recoverable.\n");
|
||||||
|
if (!fAggressive)
|
||||||
|
{
|
||||||
|
printf("Error: Rerun with aggressive mode to ignore errors and continue.\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (result != 0 && result != DB_VERIFY_BAD)
|
||||||
|
{
|
||||||
|
printf("ERROR: db salvage failed: %d\n",result);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue