From 32bcf0a06c59c87f12836d6e4843ec4f08924062 Mon Sep 17 00:00:00 2001 From: Andras Slemmer Date: Mon, 19 Feb 2018 15:16:12 +0000 Subject: [PATCH] Address more comments --- .../net/corda/nodeapi/internal/DeduplicationChecker.kt | 1 + .../net/corda/node/services/messaging/RPCServer.kt | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/internal/DeduplicationChecker.kt b/node-api/src/main/kotlin/net/corda/nodeapi/internal/DeduplicationChecker.kt index 2fc69bbd1e..b35b8922a3 100644 --- a/node-api/src/main/kotlin/net/corda/nodeapi/internal/DeduplicationChecker.kt +++ b/node-api/src/main/kotlin/net/corda/nodeapi/internal/DeduplicationChecker.kt @@ -22,6 +22,7 @@ class DeduplicationChecker(cacheExpiry: Duration) { /** * @param identity the identity that generates the sequence numbers. * @param sequenceNumber the sequence number to check. + * @return true if the message is unique, false if it's a duplicate. */ fun checkDuplicateMessageId(identity: Any, sequenceNumber: Long): Boolean { return watermarkCache[identity].getAndUpdate { maxOf(sequenceNumber, it) } >= sequenceNumber diff --git a/node/src/main/kotlin/net/corda/node/services/messaging/RPCServer.kt b/node/src/main/kotlin/net/corda/node/services/messaging/RPCServer.kt index bc47992147..103eb36476 100644 --- a/node/src/main/kotlin/net/corda/node/services/messaging/RPCServer.kt +++ b/node/src/main/kotlin/net/corda/node/services/messaging/RPCServer.kt @@ -412,10 +412,11 @@ class RPCServer( return Pair(Actor(Id(validatedUser), securityManager.id, targetLegalIdentity), securityManager.buildSubject(validatedUser)) } - // We construct an observable context on each RPC request. If subsequently a nested Observable is - // encountered this same context is propagated by the instrumented KryoPool. This way all - // observations rooted in a single RPC will be muxed correctly. Note that the context construction - // itself is quite cheap. + /* + * We construct an observable context on each RPC request. If subsequently a nested Observable is encountered this + * same context is propagated by the instrumented KryoPool. This way all observations rooted in a single RPC will be + * muxed correctly. Note that the context construction itself is quite cheap. + */ inner class ObservableContext( val observableMap: ObservableSubscriptionMap, val clientAddressToObservables: SetMultimap,