From cd52ca21ce769d89c484e01b5cc59753d0972215 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Thu, 31 Mar 2016 18:20:40 +0200 Subject: [PATCH] Minor: expose the rates oracle service (if the node provides one) as a property --- src/main/kotlin/core/node/AbstractNode.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/core/node/AbstractNode.kt b/src/main/kotlin/core/node/AbstractNode.kt index a467c125e5..4e4b070150 100644 --- a/src/main/kotlin/core/node/AbstractNode.kt +++ b/src/main/kotlin/core/node/AbstractNode.kt @@ -113,7 +113,7 @@ abstract class AbstractNode(val dir: Path, val configuration: NodeConfiguration, smm = StateMachineManager(services, serverThread) wallet = NodeWalletService(services) keyManagement = E2ETestKeyManagementService() - makeInterestRateOracleService() + makeInterestRatesOracleService() api = APIServerImpl(this) // Insert a network map entry for the timestamper: this is all temp scaffolding and will go away. If we are @@ -136,10 +136,12 @@ abstract class AbstractNode(val dir: Path, val configuration: NodeConfiguration, return this } - protected fun makeInterestRateOracleService() { - // Constructing the service registers message handlers that ensure the service won't be garbage collected. + lateinit var interestRatesService: NodeInterestRates.Service + + open protected fun makeInterestRatesOracleService() { // TODO: Once the service has data, automatically register with the network map service (once built). - _servicesThatAcceptUploads += NodeInterestRates.Service(this) + interestRatesService = NodeInterestRates.Service(this) + _servicesThatAcceptUploads += interestRatesService } protected open fun makeIdentityService(): IdentityService {