mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
wallet: Fix wallet autobackup on start (#4831)
19324 follow-up (merged via 4714) - `AutoBackupWallet()` call was unreachable. NOTE: It's safe to call it after `Verify()` because 18918 backport moved salvage logic out of `Verify*()`.
This commit is contained in:
parent
4ecc49fb73
commit
eccceaebb1
@ -5030,7 +5030,9 @@ bool CWallet::Verify(interfaces::Chain& chain, const WalletLocation& location, b
|
||||
std::unique_ptr<WalletDatabase> database = CreateWalletDatabase(wallet_path);
|
||||
|
||||
try {
|
||||
return database->Verify(error_string);
|
||||
if (!database->Verify(error_string)) {
|
||||
return false;
|
||||
}
|
||||
} catch (const fs::filesystem_error& e) {
|
||||
error_string = Untranslated(strprintf("Error loading wallet %s. %s", location.GetName(), fsbridge::get_filesystem_error_message(e)));
|
||||
return false;
|
||||
@ -5041,6 +5043,8 @@ bool CWallet::Verify(interfaces::Chain& chain, const WalletLocation& location, b
|
||||
if (!tempWallet->AutoBackupWallet(wallet_path, error_string, warnings) && !error_string.original.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::shared_ptr<CWallet> CWallet::CreateWalletFromFile(interfaces::Chain& chain, const WalletLocation& location, bilingual_str& error, std::vector<bilingual_str>& warnings, uint64_t wallet_creation_flags)
|
||||
|
Loading…
Reference in New Issue
Block a user