[#wallet-CWallet-CommitTransaction] = xref:wallet.adoc[wallet]::xref:wallet/CWallet.adoc[CWallet]::CommitTransaction :relfileprefix: ../../ :mrdocs: Submit the transaction to the node's mempool and then relay to peers. Should be called after CreateTransaction unless you want to abort broadcasting the transaction. == Synopsis Declared in `<wallet/wallet.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void CommitTransaction( xref:CTransactionRef.adoc[CTransactionRef] tx, std::optional<Txid> replaces_txid = std::nullopt, std::optional<std::string> comment = std::nullopt, std::optional<std::string> comment_to = std::nullopt, std::vector<std::string> const& messages = {}, std::vector<std::string> const& payment_requests = {}); ---- == Parameters [cols="1,4"] |=== | Name| Description | *tx* [in] | The transaction to be broadcast. | *replaces_txid* [in] | The txid of the transaction that this transaction replaces | *comment* [in] | The user's comment for this transaction | *comment_to* [in] | The comment for this transaction indicating where coins are sent to | *messages* [in] | The BIP 21 URI messages to attach to this transaction | *payment_requests* [in] | The serialized BIP 70 payment requests to attach to this transaction |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#