MCPcopy Create free account
hub / github.com/ElementsProject/elements / CreateTaprootScriptSig

Function CreateTaprootScriptSig

src/script/sign.cpp:151–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151static bool CreateTaprootScriptSig(const BaseSignatureCreator& creator, SignatureData& sigdata, const SigningProvider& provider, std::vector<unsigned char>& sig_out, const XOnlyPubKey& pubkey, const uint256& leaf_hash, SigVersion sigversion)
152{
153 auto lookup_key = std::make_pair(pubkey, leaf_hash);
154 auto it = sigdata.taproot_script_sigs.find(lookup_key);
155 if (it != sigdata.taproot_script_sigs.end()) {
156 sig_out = it->second;
157 }
158 if (creator.CreateSchnorrSig(provider, sig_out, pubkey, &leaf_hash, nullptr, sigversion)) {
159 sigdata.taproot_script_sigs[lookup_key] = sig_out;
160 return true;
161 }
162 return false;
163}
164
165static bool SignTaprootScript(const SigningProvider& provider, const BaseSignatureCreator& creator, SignatureData& sigdata, int leaf_version, const CScript& script, std::vector<valtype>& result)
166{

Callers 1

SignTaprootScriptFunction · 0.85

Calls 3

findMethod · 0.80
endMethod · 0.45
CreateSchnorrSigMethod · 0.45

Tested by

no test coverage detected