DecodeHexTx

Decode a hex-encoded serialized transaction.

Synopsis

Declared in <core_io.h>

[[nodiscard]]
bool
DecodeHexTx(
    CMutableTransaction& tx,
    std::string const& hex_tx,
    bool try_no_witness = false,
    bool try_witness = true);

Return Value

True if the transaction was decoded successfully.

NOTE

The return value should not be discarded.

Parameters

NameDescription
txTransaction populated with the decoded data on success.
hex_txHex string holding the serialized transaction.
try_no_witnessWhen true, attempt to parse the input as a non-witness (legacy) transaction.
try_witnessWhen true, attempt to parse the input as a segwit (witness) transaction.