@@ -343,7 +343,7 @@ bool BerkeleyBatch::Recover(const fs::path& file_path, void *callbackDataIn, boo
343
343
}
344
344
345
345
std::vector<BerkeleyEnvironment::KeyValPair> salvagedData;
346
- bool fSuccess = env->Salvage (newFilename, true , salvagedData);
346
+ bool fSuccess = env->Salvage (newFilename, salvagedData);
347
347
if (salvagedData.empty ())
348
348
{
349
349
LogPrintf (" Salvage(aggressive) found no records in %s.\n " , newFilename);
@@ -425,25 +425,17 @@ static const char *HEADER_END = "HEADER=END";
425
425
/* End of key/value data */
426
426
static const char *DATA_END = " DATA=END" ;
427
427
428
- bool BerkeleyEnvironment::Salvage (const std::string& strFile, bool fAggressive , std::vector<BerkeleyEnvironment::KeyValPair>& vResult)
428
+ bool BerkeleyEnvironment::Salvage (const std::string& strFile, std::vector<BerkeleyEnvironment::KeyValPair>& vResult)
429
429
{
430
430
LOCK (cs_db);
431
431
assert (mapFileUseCount.count (strFile) == 0 );
432
432
433
- u_int32_t flags = DB_SALVAGE;
434
- if (fAggressive )
435
- flags |= DB_AGGRESSIVE;
436
-
437
433
std::stringstream strDump;
438
434
439
435
Db db (dbenv.get (), 0 );
440
- int result = db.verify (strFile.c_str (), nullptr , &strDump, flags );
436
+ int result = db.verify (strFile.c_str (), nullptr , &strDump, DB_SALVAGE | DB_AGGRESSIVE );
441
437
if (result == DB_VERIFY_BAD) {
442
438
LogPrintf (" BerkeleyEnvironment::Salvage: Database salvage found errors, all data may not be recoverable.\n " );
443
- if (!fAggressive ) {
444
- LogPrintf (" BerkeleyEnvironment::Salvage: Rerun with aggressive mode to ignore errors and continue.\n " );
445
- return false ;
446
- }
447
439
}
448
440
if (result != 0 && result != DB_VERIFY_BAD) {
449
441
LogPrintf (" BerkeleyEnvironment::Salvage: Database salvage failed with result %d.\n " , result);
0 commit comments