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

Name

Description

wallet

The wallet used to fund the transaction.

tx

The transaction to be funded with additional inputs.

recipients

The recipients and amounts already present in the transaction.

change_pos

The position of the change output, or std::nullopt for a random position.

lockUnspents

Whether to lock the newly added inputs as unspent.

coin_control

Coin control settings governing input selection and fees.

Created with MrDocs