Prevent RendezvousNodes to be overwritten by empty cli flag (#1174)

This commit is contained in:
Adam Babik 2018-08-27 16:10:58 +02:00 committed by GitHub
parent 5ef26596e4
commit 776248a42f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -257,7 +257,9 @@ func makeNodeConfig() (*params.NodeConfig, error) {
nodeConfig.ClusterConfig.BootNodes = nil nodeConfig.ClusterConfig.BootNodes = nil
} }
nodeConfig.ClusterConfig.RendezvousNodes = []string(rendezvousNodes) if len(rendezvousNodes) > 0 {
nodeConfig.ClusterConfig.RendezvousNodes = []string(rendezvousNodes)
}
nodeConfig.NoDiscovery = !(*discoveryFlag) nodeConfig.NoDiscovery = !(*discoveryFlag)
nodeConfig.Rendezvous = *rendezvous nodeConfig.Rendezvous = *rendezvous
nodeConfig.RequireTopics = map[discv5.Topic]params.Limits(searchTopics) nodeConfig.RequireTopics = map[discv5.Topic]params.Limits(searchTopics)

View File

@ -122,6 +122,8 @@ func (n *StatusNode) Start(config *params.NodeConfig, services ...node.ServiceCo
n.mu.Lock() n.mu.Lock()
defer n.mu.Unlock() defer n.mu.Unlock()
n.log.Debug("starting with NodeConfig", "ClusterConfig", config.ClusterConfig)
if n.isRunning() { if n.isRunning() {
return ErrNodeRunning return ErrNodeRunning
} }