mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 02:02:42 +02:00
walletdb: Combine VerifyDatabaseFile and VerifyEnvironment
Combine these two functions into a single Verify function that is a member of WalletDatabase. Additionally, these are no longer static.
This commit is contained in:
@@ -112,7 +112,7 @@ static bool SalvageWallet(const fs::path& path)
|
||||
// Initialize the environment before recovery
|
||||
bilingual_str error_string;
|
||||
try {
|
||||
WalletBatch::VerifyEnvironment(path, error_string);
|
||||
database->Verify(error_string);
|
||||
} catch (const fs::filesystem_error& e) {
|
||||
error_string = Untranslated(strprintf("Error loading wallet. %s", fsbridge::get_filesystem_error_message(e)));
|
||||
}
|
||||
@@ -140,11 +140,6 @@ bool ExecuteWalletToolFunc(const std::string& command, const std::string& name)
|
||||
tfm::format(std::cerr, "Error: no wallet file at %s\n", name);
|
||||
return false;
|
||||
}
|
||||
bilingual_str error;
|
||||
if (!WalletBatch::VerifyEnvironment(path, error)) {
|
||||
tfm::format(std::cerr, "%s\nError loading %s. Is wallet being used by other process?\n", error.original, name);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (command == "info") {
|
||||
std::shared_ptr<CWallet> wallet_instance = LoadWallet(name, path);
|
||||
|
||||
Reference in New Issue
Block a user