mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-07 15:23:08 +00:00
add backoff when pruning because of negative score
This commit is contained in:
parent
15d204cc14
commit
6bcaacd74b
@ -387,6 +387,8 @@ func (gs *GossipSubRouter) handleGraft(p peer.ID, ctl *pb.ControlMessage) []*pb.
|
|||||||
prune = append(prune, topic)
|
prune = append(prune, topic)
|
||||||
// but we won't PX to them
|
// but we won't PX to them
|
||||||
doPX = false
|
doPX = false
|
||||||
|
// add/refresh backoff so that we don't reGRAFT too early even if the score decays back up
|
||||||
|
gs.addBackoff(p, topic)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,6 +396,7 @@ func (gs *GossipSubRouter) handleGraft(p peer.ID, ctl *pb.ControlMessage) []*pb.
|
|||||||
_, backoff := gs.backoff[topic][p]
|
_, backoff := gs.backoff[topic][p]
|
||||||
if backoff {
|
if backoff {
|
||||||
log.Debugf("GRAFT: ignoring backed off peer %s", p)
|
log.Debugf("GRAFT: ignoring backed off peer %s", p)
|
||||||
|
// refresh the backoff
|
||||||
gs.addBackoff(p, topic)
|
gs.addBackoff(p, topic)
|
||||||
prune = append(prune, topic)
|
prune = append(prune, topic)
|
||||||
continue
|
continue
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user