diff options
author | furszy <matiasfurszyfer@protonmail.com> | 2022-09-06 09:52:59 -0300 |
---|---|---|
committer | furszy <matiasfurszyfer@protonmail.com> | 2022-09-09 15:35:04 -0300 |
commit | d26c3cc44438ecb9e4f618a2427c3c92a292aa16 (patch) | |
tree | fbf13bc0c5da9deb50031da25090f07913c8495e /src/wallet/wallet.cpp | |
parent | 5291933fedceb9df16eb9e4627b1d7386b53ba07 (diff) | |
download | bitcoin-d26c3cc44438ecb9e4f618a2427c3c92a292aa16.tar.xz |
wallet: bugfix, load wallet with an unknown descriptor cause fatal error
If the descriptor entry is unrecognized/corrupt, the unserialization fails and
`LoadWallet` instead of stop there and return the error, continues reading all
the db records. As other records tied to the unrecognized/corrupted descriptor
are scanned, a fatal error is thrown.
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r-- | src/wallet/wallet.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 0949045ff0..784ea24b98 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2819,8 +2819,12 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri warnings.push_back(strprintf(_("Error reading %s! Transaction data may be missing or incorrect." " Rescanning wallet."), walletFile)); rescan_required = true; - } - else { + } else if (nLoadWalletRet == DBErrors::UNKNOWN_DESCRIPTOR) { + error = strprintf(_("Unrecognized descriptor found. Loading wallet %s\n\n" + "The wallet might had been created on a newer version.\n" + "Please try running the latest software version.\n"), walletFile); + return nullptr; + } else { error = strprintf(_("Error loading %s"), walletFile); return nullptr; } |