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

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.

Created with MrDocs