aboutsummaryrefslogtreecommitdiffstats
path: root/ethereum.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethereum.go')
-rw-r--r--ethereum.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/ethereum.go b/ethereum.go
index 54949d195..ce8a92b58 100644
--- a/ethereum.go
+++ b/ethereum.go
@@ -233,7 +233,7 @@ func (s *Ethereum) ConnectToPeer(addr string) error {
if s.peers.Len() < s.MaxPeers {
var alreadyConnected bool
- ahost, _, _ := net.SplitHostPort(addr)
+ ahost, aport, _ := net.SplitHostPort(addr)
var chost string
ips, err := net.LookupIP(ahost)
@@ -273,9 +273,9 @@ func (s *Ethereum) ConnectToPeer(addr string) error {
if p.conn == nil {
return
}
- phost, _, _ := net.SplitHostPort(p.conn.RemoteAddr().String())
+ phost, pport, _ := net.SplitHostPort(p.conn.RemoteAddr().String())
- if phost == chost {
+ if phost == chost && pport == aport {
alreadyConnected = true
//loggerger.Debugf("Peer %s already added.\n", chost)
return
@@ -419,6 +419,7 @@ func (s *Ethereum) Start(seed bool) {
if seed {
s.Seed()
}
+ s.ConnectToPeer("localhost:40404")
loggerger.Infoln("Server started")
}
@@ -471,7 +472,6 @@ func (s *Ethereum) Seed() {
s.ProcessPeerList(peers)
}
- // XXX tmp
s.ConnectToPeer(seedNodeAddress)
}
}