mirror of
https://github.com/corda/corda.git
synced 2025-06-06 09:21:47 +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(
|
data class SendMultiple(
|
||||||
val sendInitial: List<SendInitial>,
|
val sendInitial: List<SendInitial>,
|
||||||
val sendExisting: List<SendExisting>
|
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].
|
* Persist the specified [checkpoint].
|
||||||
|
@ -289,7 +289,9 @@ class StartedFlowTransition(
|
|||||||
}
|
}
|
||||||
} ?: emptyList()
|
} ?: emptyList()
|
||||||
|
|
||||||
|
if (sendInitialActions.isNotEmpty() || sendExistingActions.isNotEmpty()) {
|
||||||
actions.add(Action.SendMultiple(sendInitialActions, sendExistingActions))
|
actions.add(Action.SendMultiple(sendInitialActions, sendExistingActions))
|
||||||
|
}
|
||||||
currentState = currentState.copy(checkpoint = checkpoint.copy(sessions = newSessions))
|
currentState = currentState.copy(checkpoint = checkpoint.copy(sessions = newSessions))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user