@@ -800,6 +800,7 @@ class AddressDescriptor final : public DescriptorImpl
800
800
return OutputTypeFromDestination (m_destination);
801
801
}
802
802
bool IsSingleType () const final { return true ; }
803
+ bool IsSingleKey () const final { return false ; }
803
804
bool ToPrivateString (const SigningProvider& arg, std::string& out) const final { return false ; }
804
805
805
806
std::optional<int64_t > ScriptSize () const override { return GetScriptForDestination (m_destination).size (); }
@@ -827,6 +828,7 @@ class RawDescriptor final : public DescriptorImpl
827
828
return OutputTypeFromDestination (dest);
828
829
}
829
830
bool IsSingleType () const final { return true ; }
831
+ bool IsSingleKey () const final { return false ; }
830
832
bool ToPrivateString (const SigningProvider& arg, std::string& out) const final { return false ; }
831
833
832
834
std::optional<int64_t > ScriptSize () const override { return m_script.size (); }
@@ -855,6 +857,7 @@ class PKDescriptor final : public DescriptorImpl
855
857
public:
856
858
PKDescriptor (std::unique_ptr<PubkeyProvider> prov, bool xonly = false ) : DescriptorImpl(Vector(std::move(prov)), " pk" ), m_xonly(xonly) {}
857
859
bool IsSingleType () const final { return true ; }
860
+ bool IsSingleKey () const final { return true ; }
858
861
859
862
std::optional<int64_t > ScriptSize () const override {
860
863
return 1 + (m_xonly ? 32 : m_pubkey_args[0 ]->GetSize ()) + 1 ;
@@ -891,6 +894,7 @@ class PKHDescriptor final : public DescriptorImpl
891
894
PKHDescriptor (std::unique_ptr<PubkeyProvider> prov) : DescriptorImpl(Vector(std::move(prov)), " pkh" ) {}
892
895
std::optional<OutputType> GetOutputType () const override { return OutputType::LEGACY; }
893
896
bool IsSingleType () const final { return true ; }
897
+ bool IsSingleKey () const final { return true ; }
894
898
895
899
std::optional<int64_t > ScriptSize () const override { return 1 + 1 + 1 + 20 + 1 + 1 ; }
896
900
@@ -925,6 +929,7 @@ class WPKHDescriptor final : public DescriptorImpl
925
929
WPKHDescriptor (std::unique_ptr<PubkeyProvider> prov) : DescriptorImpl(Vector(std::move(prov)), " wpkh" ) {}
926
930
std::optional<OutputType> GetOutputType () const override { return OutputType::BECH32; }
927
931
bool IsSingleType () const final { return true ; }
932
+ bool IsSingleKey () const final { return true ; }
928
933
929
934
std::optional<int64_t > ScriptSize () const override { return 1 + 1 + 20 ; }
930
935
@@ -967,6 +972,7 @@ class ComboDescriptor final : public DescriptorImpl
967
972
public:
968
973
ComboDescriptor (std::unique_ptr<PubkeyProvider> prov) : DescriptorImpl(Vector(std::move(prov)), " combo" ) {}
969
974
bool IsSingleType () const final { return false ; }
975
+ bool IsSingleKey () const final { return true ; }
970
976
std::unique_ptr<DescriptorImpl> Clone () const override
971
977
{
972
978
return std::make_unique<ComboDescriptor>(m_pubkey_args.at (0 )->Clone ());
@@ -991,6 +997,7 @@ class MultisigDescriptor final : public DescriptorImpl
991
997
public:
992
998
MultisigDescriptor (int threshold, std::vector<std::unique_ptr<PubkeyProvider>> providers, bool sorted = false ) : DescriptorImpl(std::move(providers), sorted ? " sortedmulti" : " multi" ), m_threshold(threshold), m_sorted(sorted) {}
993
999
bool IsSingleType () const final { return true ; }
1000
+ bool IsSingleKey () const final { return false ; }
994
1001
995
1002
std::optional<int64_t > ScriptSize () const override {
996
1003
const auto n_keys = m_pubkey_args.size ();
@@ -1042,6 +1049,7 @@ class MultiADescriptor final : public DescriptorImpl
1042
1049
public:
1043
1050
MultiADescriptor (int threshold, std::vector<std::unique_ptr<PubkeyProvider>> providers, bool sorted = false ) : DescriptorImpl(std::move(providers), sorted ? " sortedmulti_a" : " multi_a" ), m_threshold(threshold), m_sorted(sorted) {}
1044
1051
bool IsSingleType () const final { return true ; }
1052
+ bool IsSingleKey () const final { return false ; }
1045
1053
1046
1054
std::optional<int64_t > ScriptSize () const override {
1047
1055
const auto n_keys = m_pubkey_args.size ();
@@ -1088,6 +1096,7 @@ class SHDescriptor final : public DescriptorImpl
1088
1096
return OutputType::LEGACY;
1089
1097
}
1090
1098
bool IsSingleType () const final { return true ; }
1099
+ bool IsSingleKey () const final { return m_subdescriptor_args[0 ]->IsSingleKey (); }
1091
1100
1092
1101
std::optional<int64_t > ScriptSize () const override { return 1 + 1 + 20 + 1 ; }
1093
1102
@@ -1129,6 +1138,7 @@ class WSHDescriptor final : public DescriptorImpl
1129
1138
WSHDescriptor (std::unique_ptr<DescriptorImpl> desc) : DescriptorImpl({}, std::move(desc), " wsh" ) {}
1130
1139
std::optional<OutputType> GetOutputType () const override { return OutputType::BECH32; }
1131
1140
bool IsSingleType () const final { return true ; }
1141
+ bool IsSingleKey () const final { return m_subdescriptor_args[0 ]->IsSingleKey (); }
1132
1142
1133
1143
std::optional<int64_t > ScriptSize () const override { return 1 + 1 + 32 ; }
1134
1144
@@ -1207,6 +1217,7 @@ class TRDescriptor final : public DescriptorImpl
1207
1217
}
1208
1218
std::optional<OutputType> GetOutputType () const override { return OutputType::BECH32M; }
1209
1219
bool IsSingleType () const final { return true ; }
1220
+ bool IsSingleKey () const final { return false ; }
1210
1221
1211
1222
std::optional<int64_t > ScriptSize () const override { return 1 + 1 + 32 ; }
1212
1223
@@ -1334,6 +1345,7 @@ class MiniscriptDescriptor final : public DescriptorImpl
1334
1345
1335
1346
bool IsSolvable () const override { return true ; }
1336
1347
bool IsSingleType () const final { return true ; }
1348
+ bool IsSingleKey () const final { return false ; }
1337
1349
1338
1350
std::optional<int64_t > ScriptSize () const override { return m_node->ScriptSize (); }
1339
1351
@@ -1373,6 +1385,7 @@ class RawTRDescriptor final : public DescriptorImpl
1373
1385
RawTRDescriptor (std::unique_ptr<PubkeyProvider> output_key) : DescriptorImpl(Vector(std::move(output_key)), " rawtr" ) {}
1374
1386
std::optional<OutputType> GetOutputType () const override { return OutputType::BECH32M; }
1375
1387
bool IsSingleType () const final { return true ; }
1388
+ bool IsSingleKey () const final { return false ; }
1376
1389
1377
1390
std::optional<int64_t > ScriptSize () const override { return 1 + 1 + 32 ; }
1378
1391
0 commit comments