Changeset View
Changeset View
Standalone View
Standalone View
src/psbt.cpp
Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Lines | void UpdatePSBTOutput(const SigningProvider &provider, | ||||
// Fill a SignatureData with output info | // Fill a SignatureData with output info | ||||
SignatureData sigdata; | SignatureData sigdata; | ||||
psbt_out.FillSignatureData(sigdata); | psbt_out.FillSignatureData(sigdata); | ||||
// Construct a would-be spend of this output, to update sigdata with. | // Construct a would-be spend of this output, to update sigdata with. | ||||
// Note that ProduceSignature is used to fill in metadata (not actual | // Note that ProduceSignature is used to fill in metadata (not actual | ||||
// signatures), so provider does not need to provide any private keys (it | // signatures), so provider does not need to provide any private keys (it | ||||
// can be a HidingSigningProvider). | // can be a HidingSigningProvider). | ||||
MutableTransactionSignatureCreator creator(psbt.tx.get_ptr(), /* index */ 0, | MutableTransactionSignatureCreator creator( | ||||
out.nValue, | psbt.tx.has_value() ? &psbt.tx.value() : nullptr, /* index */ 0, | ||||
SigHashType().withForkId()); | out.nValue, SigHashType().withForkId()); | ||||
ProduceSignature(provider, creator, out.scriptPubKey, sigdata); | ProduceSignature(provider, creator, out.scriptPubKey, sigdata); | ||||
// Put redeem_script and key paths, into PSBTOutput. | // Put redeem_script and key paths, into PSBTOutput. | ||||
psbt_out.FromSignatureData(sigdata); | psbt_out.FromSignatureData(sigdata); | ||||
} | } | ||||
bool SignPSBTInput(const SigningProvider &provider, | bool SignPSBTInput(const SigningProvider &provider, | ||||
PartiallySignedTransaction &psbt, int index, | PartiallySignedTransaction &psbt, int index, | ||||
▲ Show 20 Lines • Show All 143 Lines • Show Last 20 Lines |