taproot: Use pre-existing signatures if available

Actually use pre-existing signatures in CreateTaprootScriptSig if a
signature is found for the given key and leaf hash.
This commit is contained in:
Andrew Chow
2021-07-26 16:23:50 -04:00
parent 0ad21e7c55
commit 496a1bbe5e
2 changed files with 2 additions and 2 deletions

View File

@@ -150,6 +150,7 @@ static bool CreateTaprootScriptSig(const BaseSignatureCreator& creator, Signatur
auto it = sigdata.taproot_script_sigs.find(lookup_key);
if (it != sigdata.taproot_script_sigs.end()) {
sig_out = it->second;
return true;
}
if (creator.CreateSchnorrSig(provider, sig_out, pubkey, &leaf_hash, nullptr, sigversion)) {
sigdata.taproot_script_sigs[lookup_key] = sig_out;