SignTransactionFlow.checkTransaction - corda

corda / net.corda.core.flows / SignTransactionFlow / checkTransaction

# checkTransaction

`@Suspendable protected abstract fun checkTransaction(stx: SignedTransaction): Unit`

The checkTransaction method allows the caller of this flow to provide some additional checks over the proposed transaction received from the counterparty. For example:

- Ensuring that the transaction you are receiving is the transaction you EXPECT to receive. I.e. is has the expected type and number of inputs and outputs
- Checking that the properties of the outputs are as you would expect. Linking into any reference data sources might be appropriate here
- Checking that the transaction is not incorrectly spending (perhaps maliciously) one of your asset states, as potentially the transaction creator has access to some of your state references

WARNING: If appropriate checks, such as the ones listed above, are not defined then it is likely that your node will sign any transaction if it conforms to the contract code in the transaction's referenced contracts.

IllegalArgumentException, IllegalStateException and AssertionError will be caught and rethrown as flow exceptions i.e. the other side will be given information about what exact check failed.

### Parameters

`stx` - a partially signed transaction received from your counterparty.

### Exceptions

`FlowException` - if the proposed transaction fails the checks.