diff options
author | Felix Lange <fjl@twurst.com> | 2016-05-18 17:31:00 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-05-18 18:19:04 +0800 |
commit | 542b839ec74ff0ce94ab0d34e25531f5819d95d1 (patch) | |
tree | 75fa706a695285a134efc5d3c7ed4a5f497e04b3 /node | |
parent | c8a8ad97f7e8889ca9f3aece7ddb50cce8ef18c7 (diff) | |
download | go-tangerine-542b839ec74ff0ce94ab0d34e25531f5819d95d1.tar.gz go-tangerine-542b839ec74ff0ce94ab0d34e25531f5819d95d1.tar.zst go-tangerine-542b839ec74ff0ce94ab0d34e25531f5819d95d1.zip |
node, p2p: move network config out of Server
This silences a go vet message about copying p2p.Server in package node.
Diffstat (limited to 'node')
-rw-r--r-- | node/node.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/node/node.go b/node/node.go index 06a1b7aed..1f517a027 100644 --- a/node/node.go +++ b/node/node.go @@ -49,7 +49,7 @@ type Node struct { datadir string // Path to the currently used data directory eventmux *event.TypeMux // Event multiplexer used between the services of a stack - serverConfig *p2p.Server // Configuration of the underlying P2P networking layer + serverConfig p2p.Config server *p2p.Server // Currently running P2P networking layer serviceFuncs []ServiceConstructor // Service constructors (in dependency order) @@ -97,7 +97,7 @@ func New(conf *Config) (*Node, error) { } return &Node{ datadir: conf.DataDir, - serverConfig: &p2p.Server{ + serverConfig: p2p.Config{ PrivateKey: conf.NodeKey(), Name: conf.Name, Discovery: !conf.NoDiscovery, @@ -151,9 +151,7 @@ func (n *Node) Start() error { return ErrNodeRunning } // Otherwise copy and specialize the P2P configuration - running := new(p2p.Server) - *running = *n.serverConfig - + running := &p2p.Server{Config: n.serverConfig} services := make(map[reflect.Type]Service) for _, constructor := range n.serviceFuncs { // Create a new context for the particular service |