Bugfix: set x-only flag when inferring pk() inside tr()

This commit is contained in:
Pieter Wuille 2022-02-14 18:11:39 -05:00
parent 8fe6f5a6fb
commit 18ad54c3b2

View file

@ -1253,7 +1253,7 @@ std::unique_ptr<DescriptorImpl> InferScript(const CScript& script, ParseScriptCo
{ {
if (ctx == ParseScriptContext::P2TR && script.size() == 34 && script[0] == 32 && script[33] == OP_CHECKSIG) { if (ctx == ParseScriptContext::P2TR && script.size() == 34 && script[0] == 32 && script[33] == OP_CHECKSIG) {
XOnlyPubKey key{Span{script}.subspan(1, 32)}; XOnlyPubKey key{Span{script}.subspan(1, 32)};
return std::make_unique<PKDescriptor>(InferXOnlyPubkey(key, ctx, provider)); return std::make_unique<PKDescriptor>(InferXOnlyPubkey(key, ctx, provider), true);
} }
std::vector<std::vector<unsigned char>> data; std::vector<std::vector<unsigned char>> data;