diff --git a/p2p/rlpx.go b/p2p/rlpx.go index b97f9e89c0..24037ecc13 100644 --- a/p2p/rlpx.go +++ b/p2p/rlpx.go @@ -108,9 +108,8 @@ func (t *rlpx) close(err error) { // Tell the remote end why we're disconnecting if possible. if t.rw != nil { if r, ok := err.(DiscReason); ok && r != DiscNetworkError { - if err = t.fd.SetWriteDeadline(time.Now().Add(discWriteTimeout)); err == nil { - SendItems(t.rw, discMsg, r) - } + t.fd.SetWriteDeadline(time.Now().Add(discWriteTimeout)) + SendItems(t.rw, discMsg, r) } } t.fd.Close()