diff options
| author | Glenn Willen <[email protected]> | 2018-10-26 15:28:48 -0700 |
|---|---|---|
| committer | Glenn Willen <[email protected]> | 2018-11-01 12:11:24 -0700 |
| commit | 53e6fffb8f5b10f94708d33d667a67cb91c2d09d (patch) | |
| tree | 3d4d13a3f3110c0defedc347ff7b280cb7216289 /src/script/sign.cpp | |
| parent | New PartiallySignedTransaction constructor from CTransction (diff) | |
| download | discoin-53e6fffb8f5b10f94708d33d667a67cb91c2d09d.tar.xz discoin-53e6fffb8f5b10f94708d33d667a67cb91c2d09d.zip | |
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.
Diffstat (limited to 'src/script/sign.cpp')
| -rw-r--r-- | src/script/sign.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/script/sign.cpp b/src/script/sign.cpp index bcf110896..5cdc0112d 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -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; } |