aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2023-07-10 12:20:14 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2023-07-11 11:34:25 -0300
commit286e0c7d5e9538198b28b792c5168b8fafa1534f (patch)
tree65f0333acc28e716d0e94b0c1703e2c2a07971cc /src/wallet
parent79e8247ddb166f9b980f40249b7372a502402a4d (diff)
wallet: loading, log descriptor parsing error details
The `UNKNOWN_DESCRIPTOR` error comes from the `WalletDescriptor::DeserializeDescriptor` std::ios_base exception, which contains further information about the parsing error.
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/walletdb.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp
index ffe5fd4a18..8212c04464 100644
--- a/src/wallet/walletdb.cpp
+++ b/src/wallet/walletdb.cpp
@@ -794,11 +794,13 @@ static DBErrors LoadDescriptorWalletRecords(CWallet* pwallet, DatabaseBatch& bat
WalletDescriptor desc;
try {
value >> desc;
- } catch (const std::ios_base::failure&) {
+ } catch (const std::ios_base::failure& e) {
strErr = strprintf("Error: Unrecognized descriptor found in wallet %s. ", pwallet->GetName());
strErr += (last_client > CLIENT_VERSION) ? "The wallet might had been created on a newer version. " :
"The database might be corrupted or the software version is not compatible with one of your wallet descriptors. ";
strErr += "Please try running the latest software version";
+ // Also include error details
+ strErr = strprintf("%s\nDetails: %s", strErr, e.what());
return DBErrors::UNKNOWN_DESCRIPTOR;
}
pwallet->LoadDescriptorScriptPubKeyMan(id, desc);