From c051026586fb269584bcba41de8a4a90280f5a7e Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Wed, 12 Oct 2022 19:25:22 +0200 Subject: [PATCH] wallet: add method for retrieving the end range for a ScriptPubKeyMan --- src/wallet/scriptpubkeyman.cpp | 5 +++++ src/wallet/scriptpubkeyman.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index c432bfc221c..4c534d64ec9 100644 --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -2660,6 +2660,11 @@ const std::unordered_set DescriptorScriptPubKeyMan::Ge return script_pub_keys; } +int32_t DescriptorScriptPubKeyMan::GetEndRange() const +{ + return m_max_cached_index + 1; +} + bool DescriptorScriptPubKeyMan::GetDescriptorString(std::string& out, const bool priv) const { LOCK(cs_desc_man); diff --git a/src/wallet/scriptpubkeyman.h b/src/wallet/scriptpubkeyman.h index 4ff7fdb1547..eb77015956a 100644 --- a/src/wallet/scriptpubkeyman.h +++ b/src/wallet/scriptpubkeyman.h @@ -644,6 +644,7 @@ public: const WalletDescriptor GetWalletDescriptor() const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man); const std::unordered_set GetScriptPubKeys() const override; const std::unordered_set GetScriptPubKeys(int32_t minimum_index) const; + int32_t GetEndRange() const; bool GetDescriptorString(std::string& out, const bool priv) const;