aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorPieter Wuille <pieter@wuille.net>2021-11-09 23:09:00 -0500
committerPieter Wuille <pieter@wuille.net>2022-07-19 17:36:12 -0400
commite1e3081200a71b6c9b0dcf236bc2a37ed1aa7552 (patch)
tree320d6f96180930d756de9f498e608beb9672a7d8 /src/script
parent8d9670ccb756592bddb2a269bf5078d62658537b (diff)
If P2TR tweaked key is available, sign with it
Diffstat (limited to 'src/script')
-rw-r--r--src/script/sign.cpp5
1 files changed, 5 insertions, 0 deletions
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;