[#Consensus-CheckTxInputs] = xref:Consensus.adoc[Consensus]::CheckTxInputs :relfileprefix: ../ :mrdocs: 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>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] bool CheckTxInputs( xref:CTransaction.adoc[CTransaction] const& tx, xref:TxValidationState.adoc[TxValidationState]& state, xref:CCoinsViewCache.adoc[CCoinsViewCache] const& inputs, int nSpendHeight, xref:CAmount.adoc[CAmount]& txfee); ---- == Return Value true if all inputs exist, are spendable, and amounts balance. [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | 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. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#