[#DecodeHexTx]
= DecodeHexTx
:mrdocs:

Decode a hex&hyphen;encoded serialized transaction&period;

== Synopsis

Declared in `&lt;core&lowbar;io&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
bool
DecodeHexTx(
    xref:CMutableTransaction.adoc[CMutableTransaction]& tx,
    std::string const& hex&lowbar;tx,
    bool try&lowbar;no&lowbar;witness = false,
    bool try&lowbar;witness = true);
----

== Return Value

True if the transaction was decoded successfully&period;

[NOTE]
====
The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^].
====
== Parameters

[cols="1,4"]
|===
| Name| Description
| *tx*
| Transaction populated with the decoded data on success&period;
| *hex&lowbar;tx*
| Hex string holding the serialized transaction&period;
| *try&lowbar;no&lowbar;witness*
| When true, attempt to parse the input as a non&hyphen;witness (legacy) transaction&period;
| *try&lowbar;witness*
| When true, attempt to parse the input as a segwit (witness) transaction&period;
|===


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