mirror of
https://github.com/corda/corda.git
synced 2024-12-21 13:57:54 +00:00
[CORDA-3628] - Avoid sending actions to the state machine if no messages are to be sent (#6074)
This commit is contained in:
parent
80cf34b81a
commit
eba113621c
@ -46,7 +46,11 @@ sealed class Action {
|
||||
data class SendMultiple(
|
||||
val sendInitial: List<SendInitial>,
|
||||
val sendExisting: List<SendExisting>
|
||||
): Action()
|
||||
): Action() {
|
||||
init {
|
||||
check(sendInitial.isNotEmpty() || sendExisting.isNotEmpty()) { "At least one of the lists with initial or existing session messages should contain items." }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Persist the specified [checkpoint].
|
||||
|
@ -289,7 +289,9 @@ class StartedFlowTransition(
|
||||
}
|
||||
} ?: emptyList()
|
||||
|
||||
actions.add(Action.SendMultiple(sendInitialActions, sendExistingActions))
|
||||
if (sendInitialActions.isNotEmpty() || sendExistingActions.isNotEmpty()) {
|
||||
actions.add(Action.SendMultiple(sendInitialActions, sendExistingActions))
|
||||
}
|
||||
currentState = currentState.copy(checkpoint = checkpoint.copy(sessions = newSessions))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user