diff options
author | w0xlt <woltx@protonmail.com> | 2022-08-12 02:17:48 -0300 |
---|---|---|
committer | w0xlt <woltx@protonmail.com> | 2022-08-17 13:54:51 -0300 |
commit | 416ceb8661117235c76f2985512473ebbc64956b (patch) | |
tree | 9bf4130a173cdb2f825fe2599ab04aef240e89bf /src/script | |
parent | a75b7796b7b37be0d313d10a2ed683534ce7e95a (diff) |
descriptor: check if `rawtr` has only one key.
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/descriptor.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/script/descriptor.cpp b/src/script/descriptor.cpp index 9bcbe1ceef..953d6a7ec6 100644 --- a/src/script/descriptor.cpp +++ b/src/script/descriptor.cpp @@ -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; |