check exact expiration date of backoff when pruning because of backoff
This commit is contained in:
parent
6bcaacd74b
commit
f70dcbe77c
@ -368,6 +368,7 @@ func (gs *GossipSubRouter) handleGraft(p peer.ID, ctl *pb.ControlMessage) []*pb.
|
|||||||
|
|
||||||
doPX := true
|
doPX := true
|
||||||
score := gs.score.Score(p)
|
score := gs.score.Score(p)
|
||||||
|
now := time.Now()
|
||||||
|
|
||||||
for _, graft := range ctl.GetGraft() {
|
for _, graft := range ctl.GetGraft() {
|
||||||
topic := graft.GetTopicID()
|
topic := graft.GetTopicID()
|
||||||
@ -393,8 +394,8 @@ func (gs *GossipSubRouter) handleGraft(p peer.ID, ctl *pb.ControlMessage) []*pb.
|
|||||||
}
|
}
|
||||||
|
|
||||||
// make sure we are not backing off that peer
|
// make sure we are not backing off that peer
|
||||||
_, backoff := gs.backoff[topic][p]
|
expire, backoff := gs.backoff[topic][p]
|
||||||
if backoff {
|
if backoff && now.Before(expire) {
|
||||||
log.Debugf("GRAFT: ignoring backed off peer %s", p)
|
log.Debugf("GRAFT: ignoring backed off peer %s", p)
|
||||||
// refresh the backoff
|
// refresh the backoff
|
||||||
gs.addBackoff(p, topic)
|
gs.addBackoff(p, topic)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user