From 286e0c7d5e9538198b28b792c5168b8fafa1534f Mon Sep 17 00:00:00 2001 From: furszy Date: Mon, 10 Jul 2023 12:20:14 -0300 Subject: [PATCH] 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. --- src/wallet/walletdb.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index ffe5fd4a188..8212c044649 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);