diff options
author | Pieter Wuille <pieter@wuille.net> | 2021-03-03 16:47:44 -0800 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2021-06-12 12:25:28 -0700 |
commit | fd3f6890f3dfd683f6f13db912caf5c4288adf08 (patch) | |
tree | f59709a19027dfdc7e012189cacf72527f20d761 /src/psbt.h | |
parent | 5cb6502ac5730ea453edbec4c46027ac2ada97e0 (diff) | |
download | bitcoin-fd3f6890f3dfd683f6f13db912caf5c4288adf08.tar.xz |
Construct and use PrecomputedTransactionData in PSBT signing
Diffstat (limited to 'src/psbt.h')
-rw-r--r-- | src/psbt.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/psbt.h b/src/psbt.h index 96ae39fdb8..f6b82b43de 100644 --- a/src/psbt.h +++ b/src/psbt.h @@ -567,11 +567,18 @@ enum class PSBTRole { std::string PSBTRoleName(PSBTRole role); +/** Compute a PrecomputedTransactionData object from a psbt. */ +PrecomputedTransactionData PrecomputePSBTData(const PartiallySignedTransaction& psbt); + /** Checks whether a PSBTInput is already signed. */ bool PSBTInputSigned(const PSBTInput& input); -/** Signs a PSBTInput, verifying that all provided data matches what is being signed. */ -bool SignPSBTInput(const SigningProvider& provider, PartiallySignedTransaction& psbt, int index, int sighash = SIGHASH_ALL, SignatureData* out_sigdata = nullptr, bool use_dummy = false); +/** Signs a PSBTInput, verifying that all provided data matches what is being signed. + * + * txdata should be the output of PrecomputePSBTData (which can be shared across + * multiple SignPSBTInput calls). If it is nullptr, a dummy signature will be created. + **/ +bool SignPSBTInput(const SigningProvider& provider, PartiallySignedTransaction& psbt, int index, const PrecomputedTransactionData* txdata, int sighash = SIGHASH_ALL, SignatureData* out_sigdata = nullptr); /** Counts the unsigned inputs of a PSBT. */ size_t CountPSBTUnsignedInputs(const PartiallySignedTransaction& psbt); |