MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / FinalizePSBT

Function FinalizePSBT

src/psbt.cpp:800–818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

798}
799
800bool FinalizePSBT(PartiallySignedTransaction& psbtx)
801{
802 // Finalize input signatures -- in case we have partial signatures that add up to a complete
803 // signature, but have not combined them yet (e.g. because the combiner that created this
804 // PartiallySignedTransaction did not understand them), this will combine them into a final
805 // script.
806 bool complete = true;
807 std::optional<PrecomputedTransactionData> txdata_res = PrecomputePSBTData(psbtx);
808 if (!txdata_res) {
809 return false;
810 }
811 const PrecomputedTransactionData& txdata = *txdata_res;
812 for (unsigned int i = 0; i < psbtx.inputs.size(); ++i) {
813 PSBTInput& input = psbtx.inputs.at(i);
814 complete &= (SignPSBTInput(DUMMY_SIGNING_PROVIDER, psbtx, i, &txdata, {.sighash_type = input.sighash_type, .finalize = true}, /*out_sigdata=*/nullptr) == PSBTError::OK);
815 }
816
817 return complete;
818}
819
820bool FinalizeAndExtractPSBT(PartiallySignedTransaction& psbtx, CMutableTransaction& result)
821{

Callers 4

FinalizeAndExtractPSBTFunction · 0.85
FillPSBTMethod · 0.85
FUZZ_TARGETFunction · 0.85
openWithPSBTMethod · 0.85

Calls 4

PrecomputePSBTDataFunction · 0.85
SignPSBTInputFunction · 0.85
sizeMethod · 0.45
atMethod · 0.45

Tested by 1

FUZZ_TARGETFunction · 0.68