From 701591b403a8bae8c1dfb648a49d587968ff0c6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 30 Apr 2015 16:15:29 +0300 Subject: cmd, eth, p2p: fix review issues enumerated by Felix --- eth/backend.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'eth') 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 } -- cgit v1.2.3