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.
Declared in <consensus/tx_verify.h>
[[nodiscard]]
bool
CheckTxInputs(
CTransaction const& tx,
TxValidationState& state,
CCoinsViewCache const& inputs,
int nSpendHeight,
CAmount& txfee);
true if all inputs exist, are spendable, and amounts balance.
The return value should not be discarded.
| 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. |