aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/server.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-02-27 11:06:55 +0800
committerFelix Lange <fjl@twurst.com>2015-03-04 19:27:23 +0800
commit736e632215d49dd7bc61126f78dda4bad12768ea (patch)
tree063327c533fd57620e0448f331832e79f9ba0dda /p2p/server.go
parent51e01cceca81bc5e82896815754b7c33bb6e6005 (diff)
downloaddexon-736e632215d49dd7bc61126f78dda4bad12768ea.tar.gz
dexon-736e632215d49dd7bc61126f78dda4bad12768ea.tar.zst
dexon-736e632215d49dd7bc61126f78dda4bad12768ea.zip
p2p: use RLPx frames for messaging
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(),
})