diff --git a/brontide/conn.go b/brontide/conn.go index c64d8a64..bb1efb7f 100644 --- a/brontide/conn.go +++ b/brontide/conn.go @@ -62,8 +62,8 @@ func Dial(local keychain.SingleKeyECDH, netAddr *lnwire.NetAddress, } // We'll ensure that we get ActTwo from the remote peer in a timely - // manner. If they don't respond within 1s, then we'll kill the - // connection. + // manner. If they don't respond within handshakeReadTimeout, then + // we'll kill the connection. err = conn.SetReadDeadline(time.Now().Add(handshakeReadTimeout)) if err != nil { b.conn.Close() @@ -229,7 +229,7 @@ func (c *Conn) Flush() (int, error) { return c.noise.Flush(c.conn) } -// Close closes the connection. Any blocked Read or Write operations will be +// Close closes the connection. Any blocked Read or Write operations will be // unblocked and return errors. // // Part of the net.Conn interface. @@ -261,7 +261,7 @@ func (c *Conn) SetDeadline(t time.Time) error { return c.conn.SetDeadline(t) } -// SetReadDeadline sets the deadline for future Read calls. A zero value for t +// SetReadDeadline sets the deadline for future Read calls. A zero value for t // means Read will not time out. // // Part of the net.Conn interface. @@ -269,9 +269,9 @@ func (c *Conn) SetReadDeadline(t time.Time) error { return c.conn.SetReadDeadline(t) } -// SetWriteDeadline sets the deadline for future Write calls. Even if write +// SetWriteDeadline sets the deadline for future Write calls. Even if write // times out, it may return n > 0, indicating that some of the data was -// successfully written. A zero value for t means Write will not time out. +// successfully written. A zero value for t means Write will not time out. // // Part of the net.Conn interface. func (c *Conn) SetWriteDeadline(t time.Time) error { diff --git a/brontide/listener.go b/brontide/listener.go index f82b8457..e3f93a66 100644 --- a/brontide/listener.go +++ b/brontide/listener.go @@ -115,8 +115,8 @@ func (l *Listener) doHandshake(conn net.Conn) { } // We'll ensure that we get ActOne from the remote peer in a timely - // manner. If they don't respond within 1s, then we'll kill the - // connection. + // manner. If they don't respond within handshakeReadTimeout, then + // we'll kill the connection. err := conn.SetReadDeadline(time.Now().Add(handshakeReadTimeout)) if err != nil { brontideConn.conn.Close() @@ -160,8 +160,8 @@ func (l *Listener) doHandshake(conn net.Conn) { } // We'll ensure that we get ActTwo from the remote peer in a timely - // manner. If they don't respond within 1 second, then we'll kill the - // connection. + // manner. If they don't respond within handshakeReadTimeout, then + // we'll kill the connection. err = conn.SetReadDeadline(time.Now().Add(handshakeReadTimeout)) if err != nil { brontideConn.conn.Close() diff --git a/brontide/noise.go b/brontide/noise.go index 18bdd789..1b95b061 100644 --- a/brontide/noise.go +++ b/brontide/noise.go @@ -252,7 +252,7 @@ func (s *symmetricState) EncryptAndHash(plaintext []byte) []byte { } // DecryptAndHash returns the authenticated decryption of the passed -// ciphertext. When encrypting the handshake digest (h) is used as the +// ciphertext. When encrypting the handshake digest (h) is used as the // associated data to the AEAD cipher. func (s *symmetricState) DecryptAndHash(ciphertext []byte) ([]byte, error) { plaintext, err := s.Decrypt(s.handshakeDigest[:], nil, ciphertext) @@ -870,7 +870,7 @@ func (b *Machine) ReadHeader(r io.Reader) (uint32, error) { // ReadBody attempts to ready the next message body from the passed io.Reader. // The provided buffer MUST be the length indicated by the packet length // returned by the preceding call to ReadHeader. In the case of an -// authentication eerror, a non-nil error is returned. +// authentication error, a non-nil error is returned. func (b *Machine) ReadBody(r io.Reader, buf []byte) ([]byte, error) { // Next, using the length read from the packet header, read the // encrypted packet itself into the buffer allocated by the read