descriptor: check if rawtr has only one key.

This commit is contained in:
w0xlt
2022-08-12 02:17:48 -03:00
parent a75b7796b7
commit 416ceb8661
2 changed files with 29 additions and 0 deletions

View File

@@ -1472,6 +1472,10 @@ std::unique_ptr<DescriptorImpl> ParseScript(uint32_t& key_exp_index, Span<const
}
if (ctx == ParseScriptContext::TOP && Func("rawtr", expr)) {
auto arg = Expr(expr);
if (expr.size()) {
error = strprintf("rawtr(): only one key expected.");
return nullptr;
}
auto output_key = ParsePubkey(key_exp_index, arg, ParseScriptContext::P2TR, out, error);
if (!output_key) return nullptr;
++key_exp_index;