mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-06 13:10:09 +02:00
wallet: support fetching scriptPubKeys with minimum descriptor range index
This extra method will be needed for updating the filter set for faster wallet rescans; after an internal top-up has happened, we only want to add the newly created scriptPubKeys.
This commit is contained in:
parent
088e38d3bb
commit
845279132b
@ -2644,13 +2644,18 @@ const WalletDescriptor DescriptorScriptPubKeyMan::GetWalletDescriptor() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
const std::unordered_set<CScript, SaltedSipHasher> DescriptorScriptPubKeyMan::GetScriptPubKeys() const
|
const std::unordered_set<CScript, SaltedSipHasher> DescriptorScriptPubKeyMan::GetScriptPubKeys() const
|
||||||
|
{
|
||||||
|
return GetScriptPubKeys(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::unordered_set<CScript, SaltedSipHasher> DescriptorScriptPubKeyMan::GetScriptPubKeys(int32_t minimum_index) const
|
||||||
{
|
{
|
||||||
LOCK(cs_desc_man);
|
LOCK(cs_desc_man);
|
||||||
std::unordered_set<CScript, SaltedSipHasher> script_pub_keys;
|
std::unordered_set<CScript, SaltedSipHasher> script_pub_keys;
|
||||||
script_pub_keys.reserve(m_map_script_pub_keys.size());
|
script_pub_keys.reserve(m_map_script_pub_keys.size());
|
||||||
|
|
||||||
for (auto const& script_pub_key: m_map_script_pub_keys) {
|
for (auto const& [script_pub_key, index] : m_map_script_pub_keys) {
|
||||||
script_pub_keys.insert(script_pub_key.first);
|
if (index >= minimum_index) script_pub_keys.insert(script_pub_key);
|
||||||
}
|
}
|
||||||
return script_pub_keys;
|
return script_pub_keys;
|
||||||
}
|
}
|
||||||
|
@ -643,6 +643,7 @@ public:
|
|||||||
|
|
||||||
const WalletDescriptor GetWalletDescriptor() const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man);
|
const WalletDescriptor GetWalletDescriptor() const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man);
|
||||||
const std::unordered_set<CScript, SaltedSipHasher> GetScriptPubKeys() const override;
|
const std::unordered_set<CScript, SaltedSipHasher> GetScriptPubKeys() const override;
|
||||||
|
const std::unordered_set<CScript, SaltedSipHasher> GetScriptPubKeys(int32_t minimum_index) const;
|
||||||
|
|
||||||
bool GetDescriptorString(std::string& out, const bool priv) const;
|
bool GetDescriptorString(std::string& out, const bool priv) const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user