[#CMutableTransaction]
= CMutableTransaction
:mrdocs:

A mutable version of CTransaction&period;

== Synopsis

Declared in `&lt;primitives&sol;transaction&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct CMutableTransaction;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:CMutableTransaction/2constructor-0e.adoc[`CMutableTransaction`]         [.small]#[constructor]#
| Constructors
| xref:CMutableTransaction/GetHash.adoc[`GetHash`] 
| Compute the hash of this CMutableTransaction&period; This is computed on the fly, as opposed to GetHash() in CTransaction, which uses a cached result&period;
| xref:CMutableTransaction/HasWitness.adoc[`HasWitness`] 
| Returns true when any input carries witness data&period;
| xref:CMutableTransaction/Serialize.adoc[`Serialize`] 
| Serializes the transaction using the stream&apos;s transaction parameters&period;
| xref:CMutableTransaction/Unserialize.adoc[`Unserialize`] 
| Unserializes the transaction using the stream&apos;s transaction parameters&period;
|===


== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:CMutableTransaction/nLockTime.adoc[`nLockTime`] 
| Lock time before which the transaction is not valid&period;
| xref:CMutableTransaction/version.adoc[`version`] 
| Transaction version number&period;
| xref:CMutableTransaction/vin.adoc[`vin`] 
| Inputs spent by this transaction&period;
| xref:CMutableTransaction/vout.adoc[`vout`] 
| Outputs created by this transaction&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:AddInputs.adoc[`AddInputs`]
| Normalize univalue&hyphen;represented inputs and add them to the transaction
| xref:AddOutputs.adoc[`AddOutputs`]
| Normalize, parse, and add outputs to the transaction
| xref:ConstructTransaction.adoc[`ConstructTransaction`]
| Create a transaction from univalue parameters
| xref:DataFromTransaction.adoc[`DataFromTransaction`]
| Extract signature data from a transaction input, and insert it&period;
| xref:DecodeHexTx.adoc[`DecodeHexTx`]
| Decode a hex&hyphen;encoded serialized transaction&period;
| xref:SignTransaction-01.adoc[`SignTransaction`]
| Sign the CMutableTransaction
| xref:SignTransaction-06.adoc[`SignTransaction`]
| Sign a transaction with the given keystore and previous transactions
| xref:SignTransactionResultToJSON.adoc[`SignTransactionResultToJSON`]
| Encode the outcome of a signing attempt as a JSON object
| xref:wallet/DiscourageFeeSniping.adoc[`wallet&colon;&colon;DiscourageFeeSniping`]
| Set a height&hyphen;based locktime for new transactions (uses the height of the current chain tip unless we are not synced with the current chain
|===


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