Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13711103
D6125.id20237.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D6125.id20237.diff
View Options
diff --git a/src/script/descriptor.h b/src/script/descriptor.h
--- a/src/script/descriptor.h
+++ b/src/script/descriptor.h
@@ -32,6 +32,13 @@
/** Whether the expansion of this descriptor depends on the position. */
virtual bool IsRange() const = 0;
+ /**
+ * Whether this descriptor has all information about signing ignoring lack
+ * of private keys. This is true for all descriptors except ones that use
+ * `raw` or `addr` constructions.
+ */
+ virtual bool IsSolvable() const = 0;
+
/** Convert the descriptor back to a string, undoing parsing. */
virtual std::string ToString() const = 0;
diff --git a/src/script/descriptor.cpp b/src/script/descriptor.cpp
--- a/src/script/descriptor.cpp
+++ b/src/script/descriptor.cpp
@@ -256,6 +256,7 @@
: m_destination(std::move(destination)) {}
bool IsRange() const override { return false; }
+ bool IsSolvable() const override { return false; }
std::string ToString() const override {
return "addr(" + EncodeDestination(m_destination, GetConfig()) + ")";
}
@@ -281,6 +282,7 @@
RawDescriptor(CScript script) : m_script(std::move(script)) {}
bool IsRange() const override { return false; }
+ bool IsSolvable() const override { return false; }
std::string ToString() const override {
return "raw(" + HexStr(m_script.begin(), m_script.end()) + ")";
}
@@ -310,6 +312,7 @@
: m_script_fn(fn), m_fn_name(name), m_provider(std::move(prov)) {}
bool IsRange() const override { return m_provider->IsRange(); }
+ bool IsSolvable() const override { return true; }
std::string ToString() const override {
return m_fn_name + "(" + m_provider->ToString() + ")";
}
@@ -363,6 +366,8 @@
return false;
}
+ bool IsSolvable() const override { return true; }
+
std::string ToString() const override {
std::string ret = strprintf("multi(%i", m_threshold);
for (const auto &p : m_providers) {
@@ -426,6 +431,7 @@
m_descriptor(std::move(descriptor)) {}
bool IsRange() const override { return m_descriptor->IsRange(); }
+ bool IsSolvable() const override { return m_descriptor->IsSolvable(); }
std::string ToString() const override {
return m_fn_name + "(" + m_descriptor->ToString() + ")";
}
@@ -468,6 +474,7 @@
: m_provider(std::move(provider)) {}
bool IsRange() const override { return m_provider->IsRange(); }
+ bool IsSolvable() const override { return true; }
std::string ToString() const override {
return "combo(" + m_provider->ToString() + ")";
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 26, 10:34 (5 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5570405
Default Alt Text
D6125.id20237.diff (2 KB)
Attached To
D6125: Add Descriptor::IsSolvable() to distinguish addr/raw from others
Event Timeline
Log In to Comment