| 615 | } |
| 616 | |
| 617 | PrecomputedTransactionData PrecomputePSBTData(const PartiallySignedTransaction& psbt) |
| 618 | { |
| 619 | const CMutableTransaction tx = psbt.GetUnsignedTx(); |
| 620 | bool have_all_spent_outputs = true; |
| 621 | std::vector<CTxOut> utxos(psbt.inputs.size()); |
| 622 | for (size_t idx = 0; idx < psbt.inputs.size(); ++idx) { |
| 623 | if (!psbt.inputs[idx].GetUTXO(utxos[idx])) have_all_spent_outputs = false; |
| 624 | } |
| 625 | PrecomputedTransactionData txdata{Params().HashGenesisBlock()}; |
| 626 | if (have_all_spent_outputs) { |
| 627 | txdata.Init(tx, std::move(utxos), true); |
| 628 | } else { |
| 629 | txdata.Init(tx, {}, true); |
| 630 | } |
| 631 | return txdata; |
| 632 | } |
| 633 | |
| 634 | bool SignPSBTInput(const SigningProvider& provider, PartiallySignedTransaction& psbt, int index, const PrecomputedTransactionData* txdata, int sighash, SignatureData* out_sigdata, bool finalize) |
| 635 | { |
no test coverage detected