MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / GetDescriptorString

Method GetDescriptorString

src/wallet/scriptpubkeyman.cpp:1553–1568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1551}
1552
1553bool DescriptorScriptPubKeyMan::GetDescriptorString(std::string& out, const bool priv) const
1554{
1555 LOCK(cs_desc_man);
1556
1557 FlatSigningProvider provider;
1558 provider.keys = GetKeys();
1559
1560 if (priv) {
1561 // For the private version, always return the master key to avoid
1562 // exposing child private keys. The risk implications of exposing child
1563 // private keys together with the parent xpub may be non-obvious for users.
1564 return m_wallet_descriptor.descriptor->ToPrivateString(provider, out);
1565 }
1566
1567 return m_wallet_descriptor.descriptor->ToNormalizedString(provider, out, &m_wallet_descriptor.cache);
1568}
1569
1570void DescriptorScriptPubKeyMan::UpgradeDescriptorCache()
1571{

Callers 5

ExportDescriptorsFunction · 0.80
getaddressinfoFunction · 0.80
gethdkeysFunction · 0.80
createwalletdescriptorFunction · 0.80

Calls 2

ToPrivateStringMethod · 0.45
ToNormalizedStringMethod · 0.45

Tested by

no test coverage detected