Skip to content

Commit

Permalink
get the error
Browse files Browse the repository at this point in the history
  • Loading branch information
achow101 committed Aug 31, 2024
1 parent 70a3f2d commit 8a2a030
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/wallet/bdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ bool BerkeleyDatabase::Verify(bilingual_str& errorStr)
const std::string strFile = fs::PathToString(m_filename);
int result = db.verify(strFile.c_str(), nullptr, nullptr, 0);
if (result != 0) {
errorStr = strprintf(_("%s corrupt. Try using the wallet tool bitcoin-wallet to salvage or restoring a backup."), fs::quoted(fs::PathToString(file_path)));
errorStr = strprintf(_("%s corrupt (%d). Try using the wallet tool bitcoin-wallet to salvage or restoring a backup."), fs::quoted(fs::PathToString(file_path)), result);
return false;
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/wallet/test/fuzz/wallet_bdb_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ FUZZ_TARGET(wallet_bdb_parser, .init = initialize_wallet_bdb_parser)
if (bdb_ro_err && !db) {
return;
}
if (!db) {
std::cout << error.original << std::endl;
throw std::runtime_error(error.original);
}
assert(db);
if (bdb_ro_strict_err) {
// BerkeleyRO will be stricter than BDB. Ignore when those specific errors are hit.
Expand Down

0 comments on commit 8a2a030

Please sign in to comment.