From 6593b94594b6de40e232db6f87ebfc13217a503c Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Tue, 26 Jul 2022 16:19:51 +0300 Subject: [PATCH] cli: use new configuration for the RPC server Also fix addresses if needed and store this new configuration. --- cli/server/server.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/server/server.go b/cli/server/server.go index e864642d4..248ac67e8 100644 --- a/cli/server/server.go +++ b/cli/server/server.go @@ -542,15 +542,17 @@ Main: log.Warn("ApplicationConfiguration changed in incompatible way, signal ignored") break // Continue working. } + configureAddresses(&cfgnew.ApplicationConfiguration) switch sig { case syscall.SIGHUP: rpcServer.Shutdown() - rpcServer = rpcsrv.New(chain, cfg.ApplicationConfiguration.RPC, serv, oracleSrv, log, errChan) + rpcServer = rpcsrv.New(chain, cfgnew.ApplicationConfiguration.RPC, serv, oracleSrv, log, errChan) serv.AddService(&rpcServer) // Replaces old one by service name. - if !cfg.ApplicationConfiguration.RPC.StartWhenSynchronized || serv.IsInSync() { + if !cfgnew.ApplicationConfiguration.RPC.StartWhenSynchronized || serv.IsInSync() { rpcServer.Start() } } + cfg = cfgnew case <-grace.Done(): signal.Stop(sighupCh) serv.Shutdown()