MCPcopy Create free account
hub / github.com/Bitcoin-ABC/bitcoin-abc / UpdatePSBTOutput

Function UpdatePSBTOutput

src/psbt.cpp:164–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164void UpdatePSBTOutput(const SigningProvider &provider,
165 PartiallySignedTransaction &psbt, int index) {
166 CMutableTransaction &tx = *Assert(psbt.tx);
167 const CTxOut &out = tx.vout.at(index);
168 PSBTOutput &psbt_out = psbt.outputs.at(index);
169
170 // Fill a SignatureData with output info
171 SignatureData sigdata;
172 psbt_out.FillSignatureData(sigdata);
173
174 // Construct a would-be spend of this output, to update sigdata with.
175 // Note that ProduceSignature is used to fill in metadata (not actual
176 // signatures), so provider does not need to provide any private keys (it
177 // can be a HidingSigningProvider).
178 MutableTransactionSignatureCreator creator(&tx, /* index */ 0, out.nValue,
179 SigHashType().withForkId());
180 ProduceSignature(provider, creator, out.scriptPubKey, sigdata);
181
182 // Put redeem_script and key paths, into PSBTOutput.
183 psbt_out.FromSignatureData(sigdata);
184}
185
186bool SignPSBTInput(const SigningProvider &provider,
187 PartiallySignedTransaction &psbt, int index,

Callers 2

FillPSBTMethod · 0.85
utxoupdatepsbtFunction · 0.85

Calls 6

ProduceSignatureFunction · 0.85
atMethod · 0.80
FillSignatureDataMethod · 0.80
withForkIdMethod · 0.80
FromSignatureDataMethod · 0.80
SigHashTypeClass · 0.50

Tested by

no test coverage detected