mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
Merge 8fa03c4ddf into merged_master (Bitcoin PR bitcoin/bitcoin#21500)
This commit is contained in:
commit
08c7948081
6 changed files with 52 additions and 7 deletions
|
|
@ -2266,13 +2266,20 @@ const std::vector<CScript> DescriptorScriptPubKeyMan::GetScriptPubKeys() const
|
|||
return script_pub_keys;
|
||||
}
|
||||
|
||||
bool DescriptorScriptPubKeyMan::GetDescriptorString(std::string& out) const
|
||||
bool DescriptorScriptPubKeyMan::GetDescriptorString(std::string& out, const bool priv) const
|
||||
{
|
||||
LOCK(cs_desc_man);
|
||||
|
||||
FlatSigningProvider provider;
|
||||
provider.keys = GetKeys();
|
||||
|
||||
if (priv) {
|
||||
// For the private version, always return the master key to avoid
|
||||
// exposing child private keys. The risk implications of exposing child
|
||||
// private keys together with the parent xpub may be non-obvious for users.
|
||||
return m_wallet_descriptor.descriptor->ToPrivateString(provider, out);
|
||||
}
|
||||
|
||||
return m_wallet_descriptor.descriptor->ToNormalizedString(provider, out, &m_wallet_descriptor.cache);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue