mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
p2p: fix banning error messages a bit
This commit is contained in:
parent
fea3d9c60e
commit
e01d61bacb
1 changed files with 2 additions and 2 deletions
|
|
@ -457,7 +457,7 @@ running:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
banned[p.ID()] = time.Now().Add(penalty)
|
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:
|
case op := <-srv.peerOp:
|
||||||
// This channel is used by Peers and PeerCount.
|
// This channel is used by Peers and PeerCount.
|
||||||
op(peers)
|
op(peers)
|
||||||
|
|
@ -474,7 +474,7 @@ running:
|
||||||
// the remote identity is known (but hasn't been verified yet).
|
// the remote identity is known (but hasn't been verified yet).
|
||||||
if exp, ok := banned[c.id]; ok && time.Now().Before(exp) {
|
if exp, ok := banned[c.id]; ok && time.Now().Before(exp) {
|
||||||
glog.V(logger.Detail).Infoln("<-banned:", c)
|
glog.V(logger.Detail).Infoln("<-banned:", c)
|
||||||
c.cont <- errors.New("temporarily banned")
|
c.cont <- fmt.Errorf("banned until %v", exp)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if trusted[c.id] {
|
if trusted[c.id] {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue