mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
wallet: Add GetDescriptorString to DescriptorScriptPubKeyMan
GetDescriptorString returns a normalized descriptor for a DescriptorScriptPubKeyMan.
This commit is contained in:
parent
9be1437c49
commit
bbe4a36152
@ -2254,3 +2254,16 @@ const std::vector<CScript> DescriptorScriptPubKeyMan::GetScriptPubKeys() const
|
||||
}
|
||||
return script_pub_keys;
|
||||
}
|
||||
|
||||
bool DescriptorScriptPubKeyMan::GetDescriptorString(std::string& out, bool priv) const
|
||||
{
|
||||
LOCK(cs_desc_man);
|
||||
if (m_storage.IsLocked()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
FlatSigningProvider provider;
|
||||
provider.keys = GetKeys();
|
||||
|
||||
return m_wallet_descriptor.descriptor->ToNormalizedString(provider, out, priv);
|
||||
}
|
||||
|
@ -615,6 +615,8 @@ public:
|
||||
|
||||
const WalletDescriptor GetWalletDescriptor() const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man);
|
||||
const std::vector<CScript> GetScriptPubKeys() const;
|
||||
|
||||
bool GetDescriptorString(std::string& out, bool priv) const;
|
||||
};
|
||||
|
||||
#endif // BITCOIN_WALLET_SCRIPTPUBKEYMAN_H
|
||||
|
Loading…
Reference in New Issue
Block a user