Signs a PSBTInput, verifying that all provided data matches what is being signed.
Declared in <psbt.h>
[[nodiscard]]
util::Expected<void, common::PSBTError>
SignPSBTInput(
SigningProvider const& provider,
PartiallySignedTransaction& psbt,
int index,
PrecomputedTransactionData const* txdata,
common::PSBTFillOptions const& options,
SignatureData* out_sigdata = nullptr);
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.
Success, or a PSBTError describing why signing failed.
The return value should not be discarded.
| Name | Description |
|---|---|
| provider | The source of keys and scripts used to sign. |
| psbt | The PSBT containing the input. |
| index | The index of the input to sign. |
| txdata | Precomputed transaction data, or nullptr for a dummy signature. |
| options | Options controlling how fields are filled. |
| out_sigdata | Optional output receiving the resulting signature data. |