From aa82d4441e378566a50ced7c15d4f3be59aefc17 Mon Sep 17 00:00:00 2001 From: Andras Slemmer Date: Tue, 28 Jun 2016 14:00:49 +0100 Subject: [PATCH] irs-demo: Fix advertised services --- src/main/kotlin/com/r3corda/demos/IRSDemo.kt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/com/r3corda/demos/IRSDemo.kt b/src/main/kotlin/com/r3corda/demos/IRSDemo.kt index 8c3914be50..e1d18d390a 100644 --- a/src/main/kotlin/com/r3corda/demos/IRSDemo.kt +++ b/src/main/kotlin/com/r3corda/demos/IRSDemo.kt @@ -357,14 +357,17 @@ private fun createRecipient(addr: String) : SingleMessageRecipient { private fun startNode(params: CliParams.RunNode, networkMap: SingleMessageRecipient, recipients: List) : Node { val config = getNodeConfig(params) val advertisedServices: Set - val networkMapId = if (params.mapAddress.equals(params.address.toString())) { - // This node provides network map and notary services - advertisedServices = setOf(NetworkMapService.Type, SimpleNotaryService.Type) - null - } else { - advertisedServices = setOf(NodeInterestRates.Type) - nodeInfo(networkMap, params.identityFile, setOf(NetworkMapService.Type, SimpleNotaryService.Type)) - } + val networkMapId = + when (params.node) { + IRSDemoNode.NodeA -> { + advertisedServices = setOf(NetworkMapService.Type, SimpleNotaryService.Type) + null + } + IRSDemoNode.NodeB -> { + advertisedServices = setOf(NodeInterestRates.Type) + nodeInfo(networkMap, params.identityFile, setOf(NetworkMapService.Type, SimpleNotaryService.Type)) + } + } val node = logElapsedTime("Node startup") { Node(params.dir, params.networkAddress, params.apiAddress, config, networkMapId, advertisedServices, DemoClock(),