mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-16 17:48:59 +02:00
Fill PSBT Taproot output data to/from SignatureData
This commit is contained in:
@@ -216,11 +216,15 @@ static bool SignTaprootScript(const SigningProvider& provider, const BaseSignatu
|
||||
static bool SignTaproot(const SigningProvider& provider, const BaseSignatureCreator& creator, const WitnessV1Taproot& output, SignatureData& sigdata, std::vector<valtype>& result)
|
||||
{
|
||||
TaprootSpendData spenddata;
|
||||
TaprootBuilder builder;
|
||||
|
||||
// Gather information about this output.
|
||||
if (provider.GetTaprootSpendData(output, spenddata)) {
|
||||
sigdata.tr_spenddata.Merge(spenddata);
|
||||
}
|
||||
if (provider.GetTaprootBuilder(output, builder)) {
|
||||
sigdata.tr_builder = builder;
|
||||
}
|
||||
|
||||
// Try key path spending.
|
||||
{
|
||||
|
||||
@@ -70,6 +70,7 @@ struct SignatureData {
|
||||
CScript witness_script; ///< The witnessScript (if any) for the input. witnessScripts are used in P2WSH outputs.
|
||||
CScriptWitness scriptWitness; ///< The scriptWitness of an input. Contains complete signatures or the traditional partial signatures format. scriptWitness is part of a transaction input per BIP 144.
|
||||
TaprootSpendData tr_spenddata; ///< Taproot spending data.
|
||||
std::optional<TaprootBuilder> tr_builder; ///< Taproot tree used to build tr_spenddata.
|
||||
std::map<CKeyID, SigPair> signatures; ///< BIP 174 style partial signatures for the input. May contain all signatures necessary for producing a final scriptSig or scriptWitness.
|
||||
std::map<CKeyID, std::pair<CPubKey, KeyOriginInfo>> misc_pubkeys;
|
||||
std::vector<unsigned char> taproot_key_path_sig; /// Schnorr signature for key path spending
|
||||
|
||||
Reference in New Issue
Block a user