@@ -37,7 +37,7 @@ const (
3737//
3838// The MsgReadWriter is usually layered as follows:
3939//
40- // lockedRW ( thread-safety for ReadMsg, WriteMsg)
40+ // netWrapper (I/O timeouts, thread-safe ReadMsg, WriteMsg)
4141// rlpxFrameRW (message encoding, encryption, authentication)
4242// bufio.ReadWriter (buffering)
4343// net.Conn (network I/O)
@@ -83,7 +83,6 @@ func setupInboundConn(fd net.Conn, prv *ecdsa.PrivateKey, our *protoHandshake) (
8383 }
8484
8585 // Run the protocol handshake using authenticated messages.
86- // TODO: move buffering setup here (out of newFrameRW)
8786 rw := newRlpxFrameRW (fd , secrets )
8887 rhs , err := readProtocolHandshake (rw , our )
8988 if err != nil {
@@ -96,7 +95,7 @@ func setupInboundConn(fd net.Conn, prv *ecdsa.PrivateKey, our *protoHandshake) (
9695 if err := writeProtocolHandshake (rw , our ); err != nil {
9796 return nil , fmt .Errorf ("protocol write error: %v" , err )
9897 }
99- return & conn {& lockedRW { wrapped : rw } , rhs }, nil
98+ return & conn {rw , rhs }, nil
10099}
101100
102101func setupOutboundConn (fd net.Conn , prv * ecdsa.PrivateKey , our * protoHandshake , dial * discover.Node ) (* conn , error ) {
@@ -106,7 +105,6 @@ func setupOutboundConn(fd net.Conn, prv *ecdsa.PrivateKey, our *protoHandshake,
106105 }
107106
108107 // Run the protocol handshake using authenticated messages.
109- // TODO: move buffering setup here (out of newFrameRW)
110108 rw := newRlpxFrameRW (fd , secrets )
111109 if err := writeProtocolHandshake (rw , our ); err != nil {
112110 return nil , fmt .Errorf ("protocol write error: %v" , err )
@@ -118,7 +116,7 @@ func setupOutboundConn(fd net.Conn, prv *ecdsa.PrivateKey, our *protoHandshake,
118116 if rhs .ID != dial .ID {
119117 return nil , errors .New ("dialed node id mismatch" )
120118 }
121- return & conn {& lockedRW { wrapped : rw } , rhs }, nil
119+ return & conn {rw , rhs }, nil
122120}
123121
124122// encHandshake contains the state of the encryption handshake.
0 commit comments