descriptors: Reject + sign when parsing multi threshold

This commit is contained in:
MarcoFalke
2025-04-28 17:00:56 +02:00
parent fa6f77ed3c
commit fa55dd01df
2 changed files with 4 additions and 1 deletions

View File

@@ -1821,7 +1821,9 @@ std::vector<std::unique_ptr<DescriptorImpl>> ParseScript(uint32_t& key_exp_index
auto threshold = Expr(expr);
uint32_t thres;
std::vector<std::vector<std::unique_ptr<PubkeyProvider>>> providers; // List of multipath expanded pubkeys
if (!ParseUInt32(std::string(threshold.begin(), threshold.end()), &thres)) {
if (const auto maybe_thres{ToIntegral<uint32_t>(std::string_view{threshold.begin(), threshold.end()})}) {
thres = *maybe_thres;
} else {
error = strprintf("Multi threshold '%s' is not valid", std::string(threshold.begin(), threshold.end()));
return {};
}