aboutsummaryrefslogtreecommitdiff
path: root/src/db.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/db.cpp')
-rw-r--r--src/db.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/db.cpp b/src/db.cpp
index 52d613bc3b..3133d99bf8 100644
--- a/src/db.cpp
+++ b/src/db.cpp
@@ -164,9 +164,18 @@ bool CDBEnv::Salvage(std::string strFile, bool fAggressive,
Db db(&dbenv, 0);
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;
}