refactor: use PSBTFillOptions for filling and signing

Replace the sign, finalize , bip32derivs and sighash_type arguments which
are passed to FillPSBT() and SignPSBTInput() with a PSBTFillOptions struct.

This makes it easier to add additional options later without large code
churn, such as avoid_script_path proposed in #32857. It also makes the
use of default boolean options safer compared to positional arguments
that can easily get mixed up.
This commit is contained in:
Sjors Provoost
2025-07-04 15:09:24 +02:00
parent 8592152186
commit dc4a5d1270
20 changed files with 89 additions and 69 deletions

View File

@@ -364,14 +364,12 @@ public:
}
return {};
}
std::optional<PSBTError> fillPSBT(std::optional<int> sighash_type,
bool sign,
bool bip32derivs,
std::optional<PSBTError> fillPSBT(const common::PSBTFillOptions& options,
size_t* n_signed,
PartiallySignedTransaction& psbtx,
bool& complete) override
{
return m_wallet->FillPSBT(psbtx, complete, sighash_type, sign, bip32derivs, n_signed);
return m_wallet->FillPSBT(psbtx, options, complete, n_signed);
}
WalletBalances getBalances() override
{