diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 26c5256f6fb..1fb0ac6c90c 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3463,6 +3463,17 @@ std::set CWallet::GetActiveScriptPubKeyMans() const return spk_mans; } +bool CWallet::IsActiveScriptPubKeyMan(const ScriptPubKeyMan& spkm) const +{ + for (const auto& [_, ext_spkm] : m_external_spk_managers) { + if (ext_spkm == &spkm) return true; + } + for (const auto& [_, int_spkm] : m_internal_spk_managers) { + if (int_spkm == &spkm) return true; + } + return false; +} + std::set CWallet::GetAllScriptPubKeyMans() const { std::set spk_mans; diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 8b0ee222768..305d359a643 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -942,6 +942,7 @@ public: //! Returns all unique ScriptPubKeyMans in m_internal_spk_managers and m_external_spk_managers std::set GetActiveScriptPubKeyMans() const; + bool IsActiveScriptPubKeyMan(const ScriptPubKeyMan& spkm) const; //! Returns all unique ScriptPubKeyMans std::set GetAllScriptPubKeyMans() const;