aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/walletdb.h
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2022-11-08 01:03:07 +0100
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2022-11-08 12:29:12 +0100
commit349ed2a0eed3aaaf199ead93057c97730869c3a3 (patch)
treee72d88e97bfa75f1c669c7359be10b5d017292f7 /src/wallet/walletdb.h
parent50422b770a40f5fa964201d1e99fd6b5dc1653ca (diff)
downloadbitcoin-349ed2a0eed3aaaf199ead93057c97730869c3a3.tar.xz
wallet: throw error if legacy entries are present on loading descriptor wallets
In the wallet key-value-loading routine, most legacy type entries require a LegacyScriptPubKeyMan instance after successful deserialization. On a descriptor wallet, creating that (via method `GetOrCreateLegacyScriptPubKeyMan`) fails and then leads to a null-pointer dereference crash. Fix this by throwing an error if if the wallet flags indicate that we have a descriptor wallet and there is a legacy entry found.
Diffstat (limited to 'src/wallet/walletdb.h')
-rw-r--r--src/wallet/walletdb.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wallet/walletdb.h b/src/wallet/walletdb.h
index da6efe534b..27b5dbdd96 100644
--- a/src/wallet/walletdb.h
+++ b/src/wallet/walletdb.h
@@ -52,7 +52,8 @@ enum class DBErrors
LOAD_FAIL,
NEED_REWRITE,
NEED_RESCAN,
- UNKNOWN_DESCRIPTOR
+ UNKNOWN_DESCRIPTOR,
+ UNEXPECTED_LEGACY_ENTRY
};
namespace DBKeys {