From 8c77ae7c8480de4840708ce347c897b326b21149 Mon Sep 17 00:00:00 2001 From: Matthew Nesbit Date: Thu, 28 Jul 2016 16:54:40 +0100 Subject: [PATCH] Add comment to explain why AbstractNode is marked as SingletonSerializeAsToken --- node/src/main/kotlin/com/r3corda/node/internal/AbstractNode.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node/src/main/kotlin/com/r3corda/node/internal/AbstractNode.kt b/node/src/main/kotlin/com/r3corda/node/internal/AbstractNode.kt index 5bc82d82de..ef9f6c1c56 100644 --- a/node/src/main/kotlin/com/r3corda/node/internal/AbstractNode.kt +++ b/node/src/main/kotlin/com/r3corda/node/internal/AbstractNode.kt @@ -54,6 +54,9 @@ import java.util.* /** * A base node implementation that can be customised either for production (with real implementations that do real * I/O), or a mock implementation suitable for unit test environments. + * + * Marked as SingletonSerializeAsToken to prevent the invisible reference to AbstractNode in the ServiceHub accidentally + * sweeping up the Node into the Kryo checkpoint serialization via any protocols holding a reference to ServiceHub. */ // TODO: Where this node is the initial network map service, currently no networkMapService is provided. // In theory the NodeInfo for the node should be passed in, instead, however currently this is constructed by the