mirror of
https://github.com/corda/corda.git
synced 2025-06-16 22:28:15 +00:00
CORDA-644: Only serialise Kotlin lambdas when checkpointing. (#1801)
* Remove local function because it is serialised as a lambda. * Don't automatically whitelist Kotlin lambdas unless checkpointing. * Add comment to @CordaSerializable, warning not to allow AnnotationTarget.EXPRESSION.
This commit is contained in:
@ -404,9 +404,7 @@ class FlowStateMachineImpl<R>(override val id: StateMachineRunId,
|
||||
|
||||
@Suspendable
|
||||
private fun ReceiveRequest<*>.suspendAndExpectReceive(): ReceivedSessionMessage<*> {
|
||||
fun pollForMessage() = session.receivedMessages.poll()
|
||||
|
||||
val polledMessage = pollForMessage()
|
||||
val polledMessage = session.receivedMessages.poll()
|
||||
return if (polledMessage != null) {
|
||||
if (this is SendAndReceive) {
|
||||
// Since we've already received the message, we downgrade to a send only to get the payload out and not
|
||||
@ -417,7 +415,7 @@ class FlowStateMachineImpl<R>(override val id: StateMachineRunId,
|
||||
} else {
|
||||
// Suspend while we wait for a receive
|
||||
suspend(this)
|
||||
pollForMessage() ?:
|
||||
session.receivedMessages.poll() ?:
|
||||
throw IllegalStateException("Was expecting a ${receiveType.simpleName} but instead got nothing for $this")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user