From e01d61bacb2439fe991e177d5c6ae374b19fcdfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 28 May 2015 04:45:44 +0300 Subject: [PATCH] p2p: fix banning error messages a bit --- p2p/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/p2p/server.go b/p2p/server.go index 53bab1dcdd..9b0883136c 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -457,7 +457,7 @@ running: } } banned[p.ID()] = time.Now().Add(penalty) - glog.V(logger.Debug).Infoln("Banned", p.ID(), "until", banned[p.ID()]) + glog.V(logger.Debug).Infof("Banned %s until %v", p.ID().String()[:16], banned[p.ID()]) case op := <-srv.peerOp: // This channel is used by Peers and PeerCount. op(peers) @@ -474,7 +474,7 @@ running: // the remote identity is known (but hasn't been verified yet). if exp, ok := banned[c.id]; ok && time.Now().Before(exp) { glog.V(logger.Detail).Infoln("<-banned:", c) - c.cont <- errors.New("temporarily banned") + c.cont <- fmt.Errorf("banned until %v", exp) continue } if trusted[c.id] {