corda / net.corda.core.flows / FlowLogic / receive

# receive

`inline fun <reified R : Any> receive(otherParty: Party): UntrustworthyData<R>`

Suspends until the specified otherParty sends us a message of type R.

Remember that when receiving data from other parties the data should not be trusted until it's been thoroughly verified for consistency and that all expectations are satisfied, as a malicious peer may send you subtly corrupted data in order to exploit your code.

`@Suspendable open fun <R : Any> receive(receiveType: Class<R>, otherParty: Party): UntrustworthyData<R>`

Suspends until the specified otherParty sends us a message of type receiveType.

Remember that when receiving data from other parties the data should not be trusted until it's been thoroughly verified for consistency and that all expectations are satisfied, as a malicious peer may send you subtly corrupted data in order to exploit your code.

Returns
an UntrustworthyData wrapper around the received object.