aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-04-30 21:15:29 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-04-30 21:15:29 +0800
commit701591b403a8bae8c1dfb648a49d587968ff0c6a (patch)
tree9e253db29faf15056fa72f7a0094206b5ef39beb /eth
parent1528dbc17101597348eefe3f3fb8d4f0d5c54b3c (diff)
downloadgo-tangerine-701591b403a8bae8c1dfb648a49d587968ff0c6a.tar
go-tangerine-701591b403a8bae8c1dfb648a49d587968ff0c6a.tar.gz
go-tangerine-701591b403a8bae8c1dfb648a49d587968ff0c6a.tar.bz2
go-tangerine-701591b403a8bae8c1dfb648a49d587968ff0c6a.tar.lz
go-tangerine-701591b403a8bae8c1dfb648a49d587968ff0c6a.tar.xz
go-tangerine-701591b403a8bae8c1dfb648a49d587968ff0c6a.tar.zst
go-tangerine-701591b403a8bae8c1dfb648a49d587968ff0c6a.zip
cmd, eth, p2p: fix review issues enumerated by Felix
Diffstat (limited to 'eth')
-rw-r--r--eth/backend.go10
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
}