diff --git a/internal/noise/net.go b/internal/noise/net.go index bd76d006e4..36291ee9a5 100644 --- a/internal/noise/net.go +++ b/internal/noise/net.go @@ -216,12 +216,14 @@ func (ml *Listener) Accept() (net.Conn, error) { Initiator: ml.init, }) if err != nil { - continue + return nil, err } rw := NewReadWriter(conn, ns) if err := rw.Handshake(time.Second * 10); err != nil { + log.WithError(err).Warn("accept: noise handshake failed.") continue } + log.Infoln("accepted:", rw.RemoteStatic()) return &Conn{Conn: conn, ns: rw}, nil } } diff --git a/internal/noise/noise.go b/internal/noise/noise.go index bdd1ee92ef..4ddcabf230 100644 --- a/internal/noise/noise.go +++ b/internal/noise/noise.go @@ -11,7 +11,7 @@ import ( "github.com/skycoin/skywire/pkg/cipher" ) -var logger = logging.MustGetLogger("noise") +var log = logging.MustGetLogger("noise") // Config hold noise parameters. type Config struct { @@ -136,7 +136,7 @@ func (ns *Noise) EncryptUnsafe(plaintext []byte) []byte { func (ns *Noise) DecryptUnsafe(ciphertext []byte) ([]byte, error) { seq := binary.BigEndian.Uint32(ciphertext[:4]) if seq <= ns.previousSeq { - logger.Warnf("current seq: %s is not higher than previous one: %s. "+ + log.Warnf("current seq: %s is not higher than previous one: %s. "+ "Highest sequence number received so far is: %s", ns.seq, ns.previousSeq, ns.highestPrevious) } else { if ns.previousSeq > ns.highestPrevious {