From 451fdd26a4f638e4f68f076ba2a891222cea380c Mon Sep 17 00:00:00 2001 From: David Gumberg Date: Thu, 23 Apr 2026 15:17:32 -0700 Subject: [PATCH] test: wallet: Constructing a DSPKM that can't TopUp() throws. --- src/wallet/scriptpubkeyman.h | 7 ++++--- src/wallet/test/scriptpubkeyman_tests.cpp | 13 +++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/wallet/scriptpubkeyman.h b/src/wallet/scriptpubkeyman.h index 621630c9480..8b80a3da132 100644 --- a/src/wallet/scriptpubkeyman.h +++ b/src/wallet/scriptpubkeyman.h @@ -168,14 +168,12 @@ static const std::unordered_set LEGACY_OUTPUT_TYPES { using KeyMap = std::map; using CryptedKeyMap = std::map>>; -using ScriptPubKeyMap = std::map; // Map of scripts to descriptor range index -using PubKeyMap = std::map; // Map of pubkeys involved in scripts to descriptor range index // Manages the data for a LegacyScriptPubKeyMan. // This is the minimum necessary to load a legacy wallet so that it can be migrated. class LegacyDataSPKM : public ScriptPubKeyMan, public FillableSigningProvider { -protected: +private: using WatchOnlySet = std::set; using WatchKeyMap = std::map; @@ -277,6 +275,9 @@ class DescriptorScriptPubKeyMan : public ScriptPubKeyMan { friend class LegacyDataSPKM; private: + using ScriptPubKeyMap = std::map; // Map of scripts to descriptor range index + using PubKeyMap = std::map; // Map of pubkeys involved in scripts to descriptor range index + ScriptPubKeyMap m_map_script_pub_keys GUARDED_BY(cs_desc_man); PubKeyMap m_map_pubkeys GUARDED_BY(cs_desc_man); int32_t m_max_cached_index = -1; diff --git a/src/wallet/test/scriptpubkeyman_tests.cpp b/src/wallet/test/scriptpubkeyman_tests.cpp index 9c62436d6c0..74389a54967 100644 --- a/src/wallet/test/scriptpubkeyman_tests.cpp +++ b/src/wallet/test/scriptpubkeyman_tests.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include