diff options
author | Aaron Buchwald <[email protected]> | 2020-11-19 18:30:11 -0500 |
---|---|---|
committer | Aaron Buchwald <[email protected]> | 2020-11-19 18:30:11 -0500 |
commit | 5f5f99d0b4d12561129b6b83bc869bcac85acd58 (patch) | |
tree | 1df84cf49a411cdb28e7ca2ac7c2154a22619cdc /node | |
parent | 59453f4676ae1d778a32fd9a4edcc94d74747e14 (diff) |
Remove unnecessary p2p server from node
Diffstat (limited to 'node')
-rw-r--r-- | node/node.go | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/node/node.go b/node/node.go index 3ed89ed..e0a6424 100644 --- a/node/node.go +++ b/node/node.go @@ -113,8 +113,8 @@ func New(conf *Config) (*Node, error) { eventmux: new(event.TypeMux), log: conf.Logger, stop: make(chan struct{}), - server: &p2p.Server{Config: conf.P2P}, - databases: make(map[*closeTrackingDB]struct{}), + // server: &p2p.Server{Config: conf.P2P}, + databases: make(map[*closeTrackingDB]struct{}), } // Register built-in APIs. @@ -133,19 +133,19 @@ func New(conf *Config) (*Node, error) { node.accman = am node.ephemKeystore = ephemeralKeystore - // Initialize the p2p server. This creates the node key and discovery databases. - node.server.Config.PrivateKey = node.config.NodeKey() - node.server.Config.Name = node.config.NodeName() - node.server.Config.Logger = node.log - if node.server.Config.StaticNodes == nil { - node.server.Config.StaticNodes = node.config.StaticNodes() - } - if node.server.Config.TrustedNodes == nil { - node.server.Config.TrustedNodes = node.config.TrustedNodes() - } - if node.server.Config.NodeDatabase == "" { - node.server.Config.NodeDatabase = node.config.NodeDB() - } + // // Initialize the p2p server. This creates the node key and discovery databases. + // node.server.Config.PrivateKey = node.config.NodeKey() + // node.server.Config.Name = node.config.NodeName() + // node.server.Config.Logger = node.log + // if node.server.Config.StaticNodes == nil { + // node.server.Config.StaticNodes = node.config.StaticNodes() + // } + // if node.server.Config.TrustedNodes == nil { + // node.server.Config.TrustedNodes = node.config.TrustedNodes() + // } + // if node.server.Config.NodeDatabase == "" { + // node.server.Config.NodeDatabase = node.config.NodeDB() + // } // Configure RPC servers. @@ -161,10 +161,11 @@ func (n *Node) Config() *Config { // only to inspect fields of the currently running server. Callers should not // start or stop the returned server. func (n *Node) Server() *p2p.Server { - n.lock.Lock() - defer n.lock.Unlock() + // n.lock.Lock() + // defer n.lock.Unlock() - return n.server + // return n.server + return nil } // DataDir retrieves the current datadir used by the protocol stack. |