don't add direct peers to fanout

This commit is contained in:
vyzo 2020-08-10 13:49:50 +03:00
parent a86ae585a6
commit 3a81c24073
1 changed files with 2 additions and 1 deletions

View File

@ -903,7 +903,8 @@ func (gs *GossipSubRouter) Publish(msg *Message) {
if !ok || len(gmap) == 0 { if !ok || len(gmap) == 0 {
// we don't have any, pick some with score above the publish threshold // we don't have any, pick some with score above the publish threshold
peers := gs.getPeers(topic, gs.D, func(p peer.ID) bool { peers := gs.getPeers(topic, gs.D, func(p peer.ID) bool {
return gs.score.Score(p) >= gs.publishThreshold _, direct := gs.direct[p]
return !direct && gs.score.Score(p) >= gs.publishThreshold
}) })
if len(peers) > 0 { if len(peers) > 0 {