diff --git a/core/src/main/kotlin/com/r3corda/core/protocols/ProtocolLogicRef.kt b/core/src/main/kotlin/com/r3corda/core/protocols/ProtocolLogicRef.kt index c63bfeb6cc..5b0154cb81 100644 --- a/core/src/main/kotlin/com/r3corda/core/protocols/ProtocolLogicRef.kt +++ b/core/src/main/kotlin/com/r3corda/core/protocols/ProtocolLogicRef.kt @@ -39,7 +39,9 @@ class ProtocolLogicRefFactory(private val protocolWhitelist: Map get() = _networkMapRegistrationFuture - /** fetch CordaPluginRegistry classes registered in META-INF/services/com.r3corda.core.node.CordaPluginRegistry files that exist in the classpath */ - protected val pluginRegistries: List - get() = ServiceLoader.load(CordaPluginRegistry::class.java).toList() + /** Fetch CordaPluginRegistry classes registered in META-INF/services/com.r3corda.core.node.CordaPluginRegistry files that exist in the classpath */ + protected val pluginRegistries: List by lazy { + ServiceLoader.load(CordaPluginRegistry::class.java).toList() + } /** Set to true once [start] has been successfully called. */ @Volatile var started = false