aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/scriptpubkeyman.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2020-05-04 18:49:38 -0400
committerAndrew Chow <achow101-github@achow101.com>2020-10-09 09:04:15 -0400
commitbbe4a36152fb8d9c8c3682ca2380f1c88cca61cb (patch)
tree65306dd546f1a2ed679fc87e364375075af5d262 /src/wallet/scriptpubkeyman.cpp
parent9be1437c49f986e8ed964d5f863b4bbcec340751 (diff)
downloadbitcoin-bbe4a36152fb8d9c8c3682ca2380f1c88cca61cb.tar.xz
wallet: Add GetDescriptorString to DescriptorScriptPubKeyMan
GetDescriptorString returns a normalized descriptor for a DescriptorScriptPubKeyMan.
Diffstat (limited to 'src/wallet/scriptpubkeyman.cpp')
-rw-r--r--src/wallet/scriptpubkeyman.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp
index 51715462c5..d725f86835 100644
--- a/src/wallet/scriptpubkeyman.cpp
+++ b/src/wallet/scriptpubkeyman.cpp
@@ -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);
+}