mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
[wallet] Pass error message back from CWallet::Verify()
Pass an error message back from CWallet::Verify(), and call InitError/InitWarning from WalletInit::Verify(). This means that we can call CWallet::Verify() independently from WalletInit and not have InitErrors printed to stdout. It also means that the error can be reported to the user if dynamic wallet load fails.
This commit is contained in:
@@ -207,7 +207,12 @@ bool WalletInit::Verify() const
|
||||
return InitError(strprintf(_("Error loading wallet %s. Duplicate -wallet filename specified."), wallet_file));
|
||||
}
|
||||
|
||||
if (!CWallet::Verify(wallet_file, salvage_wallet)) return false;
|
||||
std::string error_string;
|
||||
std::string warning_string;
|
||||
bool verify_success = CWallet::Verify(wallet_file, salvage_wallet, error_string, warning_string);
|
||||
if (!error_string.empty()) InitError(error_string);
|
||||
if (!warning_string.empty()) InitWarning(warning_string);
|
||||
if (!verify_success) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user