diff --git a/ethereum.go b/ethereum.go index b178644cf3aa745ea1c3af5cedd3009a98aa0e03..fa7ce9ec787b876cbe10903f56ce5214528467ab 100644 --- a/ethereum.go +++ b/ethereum.go @@ -96,7 +96,7 @@ func (s *Ethereum) AddPeer(conn net.Conn) { if peer != nil { s.peers.PushBack(peer) - peer.Start(false) + peer.Start() } } diff --git a/peer.go b/peer.go index a715e205debf54e911236ebd90abfcd33b0650e3..e9a8f6c035131be7b7a29f7717833109d1b14d8e 100644 --- a/peer.go +++ b/peer.go @@ -76,9 +76,6 @@ type Peer struct { // this to prevent receiving false peers. requestedPeerList bool - // Determines whether this is a seed peer - seed bool - host []byte port uint16 caps Caps @@ -123,7 +120,7 @@ func NewOutboundPeer(addr string, ethereum *Ethereum, caps Caps) *Peer { atomic.StoreInt32(&p.connected, 1) atomic.StoreInt32(&p.disconnect, 0) - p.Start(false) + p.Start() }() return p @@ -155,14 +152,6 @@ func (p *Peer) writeMessage(msg *ethwire.Msg) { p.Stop() return } - - // XXX TMP CODE FOR TESTNET - switch msg.Type { - case ethwire.MsgPeersTy: - if p.seed { - p.Stop() - } - } } // Outbound message handler. Outbound messages are handled here @@ -349,9 +338,7 @@ func unpackAddr(value *ethutil.RlpValue, p uint64) string { return net.JoinHostPort(host, port) } -func (p *Peer) Start(seed bool) { - p.seed = seed - +func (p *Peer) Start() { peerHost, peerPort, _ := net.SplitHostPort(p.conn.LocalAddr().String()) servHost, servPort, _ := net.SplitHostPort(p.conn.RemoteAddr().String()) if peerHost == servHost {