aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'p2p/server.go')
-rw-r--r--p2p/server.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/p2p/server.go b/p2p/server.go
index 3ea2538d1..e53e832aa 100644
--- a/p2p/server.go
+++ b/p2p/server.go
@@ -358,14 +358,15 @@ func (srv *Server) findPeers() {
func (srv *Server) startPeer(fd net.Conn, dest *discover.Node) {
// TODO: handle/store session token
- fd.SetDeadline(time.Now().Add(handshakeTimeout))
+ // TODO: reenable deadlines
+ // fd.SetDeadline(time.Now().Add(handshakeTimeout))
conn, err := srv.setupFunc(fd, srv.PrivateKey, srv.ourHandshake, dest)
if err != nil {
fd.Close()
srvlog.Debugf("Handshake with %v failed: %v", fd.RemoteAddr(), err)
return
}
- p := newPeer(conn, srv.Protocols)
+ p := newPeer(fd, conn, srv.Protocols)
if ok, reason := srv.addPeer(conn.ID, p); !ok {
srvlog.DebugDetailf("Not adding %v (%v)\n", p, reason)
p.politeDisconnect(reason)
@@ -375,7 +376,7 @@ func (srv *Server) startPeer(fd net.Conn, dest *discover.Node) {
srvlog.Debugf("Added %v\n", p)
srvjslog.LogJson(&logger.P2PConnected{
RemoteId: fmt.Sprintf("%x", conn.ID[:]),
- RemoteAddress: conn.RemoteAddr().String(),
+ RemoteAddress: fd.RemoteAddr().String(),
RemoteVersionString: conn.Name,
NumConnections: srv.PeerCount(),
})