MCPcopy Create free account
hub / github.com/ElementsProject/elements / PrecomputePSBTData

Function PrecomputePSBTData

src/psbt.cpp:617–632  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

615}
616
617PrecomputedTransactionData 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
634bool SignPSBTInput(const SigningProvider& provider, PartiallySignedTransaction& psbt, int index, const PrecomputedTransactionData* txdata, int sighash, SignatureData* out_sigdata, bool finalize)
635{

Callers 5

FinalizePSBTFunction · 0.85
FillPSBTDataMethod · 0.85
SignPSBTMethod · 0.85
utxoupdatepsbtFunction · 0.85
AnalyzePSBTFunction · 0.85

Calls 5

GetUnsignedTxMethod · 0.80
GetUTXOMethod · 0.80
ParamsClass · 0.70
sizeMethod · 0.45
InitMethod · 0.45

Tested by

no test coverage detected