mirror of
https://github.com/corda/corda.git
synced 2025-06-01 15:10:54 +00:00
Update the demo date in order: first notary, then party nodes ordered by name.
This commit is contained in:
parent
078a9e2b70
commit
d757429043
@ -51,11 +51,22 @@ object UpdateBusinessDayFlow {
|
|||||||
@Suspendable
|
@Suspendable
|
||||||
override fun call(): Unit {
|
override fun call(): Unit {
|
||||||
progressTracker.currentStep = NOTIFYING
|
progressTracker.currentStep = NOTIFYING
|
||||||
for (recipient in serviceHub.networkMapCache.partyNodes.sortedBy { it.legalIdentity.name }) {
|
for (recipient in getRecipients()) {
|
||||||
doNextRecipient(recipient)
|
doNextRecipient(recipient)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns recipients ordered by legal name, with notary nodes taking priority over party nodes.
|
||||||
|
* Ordering is required so that we avoid situations where on clock update a party starts a scheduled flow, but
|
||||||
|
* the notary or counterparty still use the old clock, so the timestamp on the transaction does not validate.
|
||||||
|
*/
|
||||||
|
private fun getRecipients(): Iterable<NodeInfo> {
|
||||||
|
val notaryNodes = serviceHub.networkMapCache.notaryNodes
|
||||||
|
val partyNodes = (serviceHub.networkMapCache.partyNodes - notaryNodes).sortedBy { it.legalIdentity.name }
|
||||||
|
return notaryNodes + partyNodes
|
||||||
|
}
|
||||||
|
|
||||||
@Suspendable
|
@Suspendable
|
||||||
private fun doNextRecipient(recipient: NodeInfo) {
|
private fun doNextRecipient(recipient: NodeInfo) {
|
||||||
if (recipient.address is MockNetworkMapCache.MockAddress) {
|
if (recipient.address is MockNetworkMapCache.MockAddress) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user