diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-11-08 01:03:07 +0100 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-11-08 12:29:12 +0100 |
commit | 349ed2a0eed3aaaf199ead93057c97730869c3a3 (patch) | |
tree | e72d88e97bfa75f1c669c7359be10b5d017292f7 /src/wallet/walletdb.h | |
parent | 50422b770a40f5fa964201d1e99fd6b5dc1653ca (diff) | |
download | bitcoin-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.h | 3 |
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 { |