| 595 | } |
| 596 | |
| 597 | void UpdatePSBTOutput(const SigningProvider& provider, PartiallySignedTransaction& psbt, int index) |
| 598 | { |
| 599 | CMutableTransaction tx = psbt.GetUnsignedTx(); |
| 600 | const CTxOut& out = tx.vout.at(index); |
| 601 | PSBTOutput& psbt_out = psbt.outputs.at(index); |
| 602 | |
| 603 | // Fill a SignatureData with output info |
| 604 | SignatureData sigdata; |
| 605 | psbt_out.FillSignatureData(sigdata); |
| 606 | |
| 607 | // Construct a would-be spend of this output, to update sigdata with. |
| 608 | // Note that ProduceSignature is used to fill in metadata (not actual signatures), |
| 609 | // so provider does not need to provide any private keys (it can be a HidingSigningProvider). |
| 610 | MutableTransactionSignatureCreator creator(&tx, /*input_idx=*/0, out.nValue, SIGHASH_ALL); |
| 611 | ProduceSignature(provider, creator, out.scriptPubKey, sigdata); |
| 612 | |
| 613 | // Put redeem_script, witness_script, key paths, into PSBTOutput. |
| 614 | psbt_out.FromSignatureData(sigdata); |
| 615 | } |
| 616 | |
| 617 | PrecomputedTransactionData PrecomputePSBTData(const PartiallySignedTransaction& psbt) |
| 618 | { |
no test coverage detected