remove peers with negative score from fanout
This commit is contained in:
parent
80f3b8c45b
commit
712bab2c64
@ -737,10 +737,11 @@ func (gs *GossipSubRouter) heartbeat() {
|
|||||||
|
|
||||||
// maintain our fanout for topics we are publishing but we have not joined
|
// maintain our fanout for topics we are publishing but we have not joined
|
||||||
for topic, peers := range gs.fanout {
|
for topic, peers := range gs.fanout {
|
||||||
// check whether our peers are still in the topic
|
// check whether our peers are still in the topic and don't have a negative score
|
||||||
for p := range peers {
|
for p := range peers {
|
||||||
_, ok := gs.p.topics[topic][p]
|
_, ok := gs.p.topics[topic][p]
|
||||||
if !ok {
|
score := gs.score.Score(p)
|
||||||
|
if !ok || score < 0 {
|
||||||
delete(peers, p)
|
delete(peers, p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user