|
|
|
@ -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 { |
|
|
|
|