wallet::FundTransaction

Insert additional inputs into the transaction by calling CreateTransaction();

Synopsis

Declared in <wallet/spend.h>

util::Result<CreatedTransactionResult>
FundTransaction(
    CWallet& wallet,
    CMutableTransaction const& tx,
    std::vector<CRecipient> const& recipients,
    std::optional<unsigned int> change_pos,
    bool lockUnspents,
    CCoinControl coin_control);

Return Value

If successful, the funded transaction and its fee details, otherwise an error.

Parameters

NameDescription
walletThe wallet used to fund the transaction.
txThe transaction to be funded with additional inputs.
recipientsThe recipients and amounts already present in the transaction.
change_posThe position of the change output, or std::nullopt for a random position.
lockUnspentsWhether to lock the newly added inputs as unspent.
coin_controlCoin control settings governing input selection and fees.