remove unnecessary length check

This commit is contained in:
vyzo 2020-04-22 13:37:27 +03:00
parent eccded1360
commit 32c3fb325d
1 changed files with 3 additions and 5 deletions

View File

@ -1032,14 +1032,12 @@ func (gs *GossipSubRouter) heartbeat() {
return !inMesh && !doBackoff && !direct && gs.score.Score(p) > medianScore
})
if len(plst) != 0 {
for _, p := range plst {
log.Debugf("HEARTBEAT: Opportunistically graft peer %s on topic %s", p, topic)
graftPeer(p)
}
}
}
}
// 2nd arg are mesh peers excluded from gossip. We already push
// messages to them, so its redundant to gossip IHAVEs.