diff options
| author | Glenn Willen <[email protected]> | 2018-10-26 15:30:50 -0700 |
|---|---|---|
| committer | Glenn Willen <[email protected]> | 2018-11-01 12:11:24 -0700 |
| commit | 0f5bda2bd941686620ef0eb90bd7ed973cc7ef73 (patch) | |
| tree | 2d2d1a663698380947e6c83a335d9e9c1dc4a34e /src/script/sign.cpp | |
| parent | Add bool PSBTInputSigned (diff) | |
| download | discoin-0f5bda2bd941686620ef0eb90bd7ed973cc7ef73.tar.xz discoin-0f5bda2bd941686620ef0eb90bd7ed973cc7ef73.zip | |
Simplify arguments to SignPSBTInput
Remove redundant arguments to SignPSBTInput -- since it needs several
bits of the PartiallySignedTransaction, pass in a reference instead of
doing it piecemeal. This saves us having to pass in both a PSBTInput and
its index, as well as having to pass in the CTransaction. Also avoid
redundantly passing the sighash_type, which is contained in the
PSBTInput already.
Diffstat (limited to 'src/script/sign.cpp')
| -rw-r--r-- | src/script/sign.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 5cdc0112d..1e481dd54 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -244,8 +244,11 @@ 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) +bool SignPSBTInput(const SigningProvider& provider, PartiallySignedTransaction& psbt, int index, int sighash) { + PSBTInput& input = psbt.inputs.at(index); + const CMutableTransaction& tx = *psbt.tx; + if (PSBTInputSigned(input)) { return true; } |