mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
Add bool PSBTInputSigned
Refactor out a "PSBTInputSigned" function to check if a PSBT is signed, for use in subsequent commits. Also improve a related comment.
This commit is contained in:
parent
65166d4cf8
commit
53e6fffb8f
3 changed files with 14 additions and 4 deletions
|
|
@ -1536,12 +1536,15 @@ UniValue finalizepsbt(const JSONRPCRequest& request)
|
|||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, strprintf("TX decode failed %s", error));
|
||||
}
|
||||
|
||||
// Get all of the previous transactions
|
||||
// Finalize input signatures -- in case we have partial signatures that add up to a complete
|
||||
// signature, but have not combined them yet (e.g. because the combiner that created this
|
||||
// PartiallySignedTransaction did not understand them), this will combine them into a final
|
||||
// script.
|
||||
bool complete = true;
|
||||
for (unsigned int i = 0; i < psbtx.tx->vin.size(); ++i) {
|
||||
PSBTInput& input = psbtx.inputs.at(i);
|
||||
|
||||
complete &= SignPSBTInput(DUMMY_SIGNING_PROVIDER, *psbtx.tx, input, i, 1);
|
||||
complete &= SignPSBTInput(DUMMY_SIGNING_PROVIDER, *psbtx.tx, input, i, SIGHASH_ALL);
|
||||
}
|
||||
|
||||
UniValue result(UniValue::VOBJ);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue