aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-05-07 08:58:35 -0700
committerGavin Andresen <gavinandresen@gmail.com>2013-05-07 08:58:35 -0700
commite5ddaf5ec8ae703818dcdcf28c7dd6e001b6d681 (patch)
treed497acbf0f6a48c3893939d73df7c181c42d7b8f
parent7aaaff37ffb3ad71b6a5423060965ce0c2012884 (diff)
parent14c9d116be476d08dd18f2e9f4a8ed251a6bbf79 (diff)
Merge pull request #2410 from gmaxwell/salvageharder
Make explicitly requested salvage operations keep going when there is an error.
-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;
}