From 1549a29c9d6452eefa615baedfccfc5b5f6b7745 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 16 Sep 2014 16:36:27 +0200 Subject: Connect to previous peer --- peer.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'peer.go') diff --git a/peer.go b/peer.go index 69aa4b668..628953535 100644 --- a/peer.go +++ b/peer.go @@ -680,7 +680,7 @@ func (p *Peer) handleHandshake(msg *ethwire.Msg) { var ( p2pVersion = c.Get(0).Uint() clientId = c.Get(1).Str() - caps = c.Get(2).Raw() + caps = c.Get(2) port = c.Get(3).Uint() pub = c.Get(4).Bytes() ) @@ -734,11 +734,17 @@ func (p *Peer) handleHandshake(msg *ethwire.Msg) { p.ethereum.PushPeer(p) p.ethereum.reactor.Post("peerList", p.ethereum.Peers()) - ethlogger.Infof("Added peer (%s) %d / %d (%v)\n", p.conn.RemoteAddr(), p.ethereum.Peers().Len(), p.ethereum.MaxPeers, caps) + ethlogger.Infof("Added peer (%s) %d / %d (%v)\n", p.conn.RemoteAddr(), p.ethereum.Peers().Len(), p.ethereum.MaxPeers, caps.Raw()) peerlogger.Debugln(p) - p.pushStatus() + capsIt := caps.NewIterator() + for capsIt.Next() { + switch capsIt.Value().Str() { + case "eth": + p.pushStatus() + } + } } func (p *Peer) String() string { -- cgit v1.2.3