[#TxGraph-AddTransaction]
= xref:TxGraph.adoc[TxGraph]::AddTransaction
:relfileprefix: ../
:mrdocs:

Initialize arg (which must be an empty Ref) to refer to a new transaction in this graph with the specified feerate&period;

== Synopsis

Declared in `&lt;txgraph&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
void
AddTransaction(
    xref:TxGraph/Ref.adoc[Ref]& arg,
    xref:FeePerWeight.adoc[FeePerWeight] const& feerate) noexcept = 0;
----

== Description

If a staging graph exists, the new transaction is only created there&period; feerate&period;size must be strictly positive&period; In all further calls, only Refs passed to AddTransaction() are allowed to be passed to this TxGraph object (or empty Ref objects)&period; Ref objects may outlive the TxGraph they were added to&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *arg*
| Empty Ref that will be bound to the newly created transaction&period;
| *feerate*
| Fee and size of the new transaction&semi; its size must be strictly positive&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
