mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +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
|
|
@ -239,10 +239,14 @@ bool ProduceSignature(const SigningProvider& provider, const BaseSignatureCreato
|
|||
return sigdata.complete;
|
||||
}
|
||||
|
||||
bool PSBTInputSigned(PSBTInput& input)
|
||||
{
|
||||
return !input.final_script_sig.empty() || !input.final_script_witness.IsNull();
|
||||
}
|
||||
|
||||
bool SignPSBTInput(const SigningProvider& provider, const CMutableTransaction& tx, PSBTInput& input, int index, int sighash)
|
||||
{
|
||||
// if this input has a final scriptsig or scriptwitness, don't do anything with it
|
||||
if (!input.final_script_sig.empty() || !input.final_script_witness.IsNull()) {
|
||||
if (PSBTInputSigned(input)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue