mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-19 18:09:47 +01:00
wallet: Add IsActiveScriptPubKeyMan
Given a ScriptPubKeyMan, it's useful to ask the wallet whether it is currently active.
This commit is contained in:
parent
fa6a259985
commit
66632e5c24
@ -3463,6 +3463,17 @@ std::set<ScriptPubKeyMan*> 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<ScriptPubKeyMan*> CWallet::GetAllScriptPubKeyMans() const
|
||||
{
|
||||
std::set<ScriptPubKeyMan*> spk_mans;
|
||||
|
@ -942,6 +942,7 @@ public:
|
||||
|
||||
//! Returns all unique ScriptPubKeyMans in m_internal_spk_managers and m_external_spk_managers
|
||||
std::set<ScriptPubKeyMan*> GetActiveScriptPubKeyMans() const;
|
||||
bool IsActiveScriptPubKeyMan(const ScriptPubKeyMan& spkm) const;
|
||||
|
||||
//! Returns all unique ScriptPubKeyMans
|
||||
std::set<ScriptPubKeyMan*> GetAllScriptPubKeyMans() const;
|
||||
|
Loading…
Reference in New Issue
Block a user