diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-04-30 21:15:29 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-04-30 21:15:29 +0800 |
commit | 701591b403a8bae8c1dfb648a49d587968ff0c6a (patch) | |
tree | 9e253db29faf15056fa72f7a0094206b5ef39beb /eth/backend.go | |
parent | 1528dbc17101597348eefe3f3fb8d4f0d5c54b3c (diff) | |
download | go-tangerine-701591b403a8bae8c1dfb648a49d587968ff0c6a.tar.gz go-tangerine-701591b403a8bae8c1dfb648a49d587968ff0c6a.tar.zst go-tangerine-701591b403a8bae8c1dfb648a49d587968ff0c6a.zip |
cmd, eth, p2p: fix review issues enumerated by Felix
Diffstat (limited to 'eth/backend.go')
-rw-r--r-- | eth/backend.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/eth/backend.go b/eth/backend.go index c69e4a27a..11e5c25e8 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -108,7 +108,6 @@ func (cfg *Config) parseTrustedNodes() []*discover.Node { // Short circuit if no trusted node config is present path := filepath.Join(cfg.DataDir, trustedNodes) if _, err := os.Stat(path); err != nil { - fmt.Println("nodes", nil) return nil } // Load the trusted nodes from the config file @@ -122,7 +121,6 @@ func (cfg *Config) parseTrustedNodes() []*discover.Node { glog.V(logger.Error).Infof("Failed to load trusted nodes: %v", err) return nil } - fmt.Println("nodes", nodelist) // Interpret the list as a discovery node array var nodes []*discover.Node for _, url := range nodelist { @@ -486,13 +484,15 @@ func (s *Ethereum) StartForTest() { s.txPool.Start() } -// TrustPeer injects a new node into the list of privileged nodes. -func (self *Ethereum) TrustPeer(nodeURL string) error { +// AddPeer connects to the given node and maintains the connection until the +// server is shut down. If the connection fails for any reason, the server will +// attempt to reconnect the peer. +func (self *Ethereum) AddPeer(nodeURL string) error { n, err := discover.ParseNode(nodeURL) if err != nil { return fmt.Errorf("invalid node URL: %v", err) } - self.net.TrustPeer(n) + self.net.AddPeer(n) return nil } |