[#wallet-FundTransaction] = xref:wallet.adoc[wallet]::FundTransaction :relfileprefix: ../ :mrdocs: Insert additional inputs into the transaction by calling CreateTransaction(); == Synopsis Declared in `<wallet/spend.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:util/Result.adoc[util::Result<CreatedTransactionResult>] FundTransaction( xref:wallet/CWallet.adoc[CWallet]& wallet, xref:CMutableTransaction.adoc[CMutableTransaction] const& tx, std::vector<CRecipient> const& recipients, std::optional<unsigned int> change_pos, bool lockUnspents, xref:wallet/CCoinControl.adoc[CCoinControl] coin_control); ---- == Return Value If successful, the funded transaction and its fee details, otherwise an error. == Parameters [cols="1,4"] |=== | 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. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#