From e1e3081200a71b6c9b0dcf236bc2a37ed1aa7552 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 9 Nov 2021 23:09:00 -0500 Subject: [PATCH] If P2TR tweaked key is available, sign with it --- src/script/sign.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/script/sign.cpp b/src/script/sign.cpp index a3681d26cc..ee4e1aeb11 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -243,6 +243,11 @@ static bool SignTaproot(const SigningProvider& provider, const BaseSignatureCrea sigdata.taproot_key_path_sig = sig; } } + if (sigdata.taproot_key_path_sig.size() == 0) { + if (creator.CreateSchnorrSig(provider, sig, output, nullptr, nullptr, SigVersion::TAPROOT)) { + sigdata.taproot_key_path_sig = sig; + } + } if (sigdata.taproot_key_path_sig.size()) { result = Vector(sigdata.taproot_key_path_sig); return true;