Decode a hex-encoded serialized transaction.
Declared in <core_io.h>
[[nodiscard]]
bool
DecodeHexTx(
CMutableTransaction& tx,
std::string const& hex_tx,
bool try_no_witness = false,
bool try_witness = true);
True if the transaction was decoded successfully.
The return value should not be discarded.
| Name | Description |
|---|---|
| tx | Transaction populated with the decoded data on success. |
| hex_tx | Hex string holding the serialized transaction. |
| try_no_witness | When true, attempt to parse the input as a non-witness (legacy) transaction. |
| try_witness | When true, attempt to parse the input as a segwit (witness) transaction. |