Check whether all inputs of this transaction are valid (no double spends and amounts) This does not modify the UTXO set. This does not check scripts and sigs.

Synopsis

Declared in <consensus/tx_verify.h>

[[nodiscard]]
bool
CheckTxInputs(
    CTransaction const& tx,
    TxValidationState& state,
    CCoinsViewCache const& inputs,
    int nSpendHeight,
    CAmount& txfee);

Return Value

true if all inputs exist, are spendable, and amounts balance.

Note

The return value should not be discarded.

Parameters

Name

Description

txfee [out]

Set to the transaction fee if successful. Preconditions: tx.IsCoinBase() is false.

tx

The non‐coinbase transaction whose inputs are checked.

state

Receives the validation result and rejection reason on failure.

inputs

UTXO set view providing the outputs spent by tx.

nSpendHeight

Height at which tx is being spent, used for maturity checks.

Created with MrDocs