Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lnode/neighbor.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import (
"bytes"
"errors"
"fmt"
pbnode "github.com/nknorg/nnet/protobuf/node"
"math"
"math/rand"
"net"
"net/url"
"sync"
"time"

pbnode "github.com/nknorg/nnet/protobuf/node"

"github.com/nknorg/nkn/v2/chain"
"github.com/nknorg/nkn/v2/config"
"github.com/nknorg/nkn/v2/crypto"
Expand Down Expand Up @@ -305,7 +306,9 @@ func (localNode *LocalNode) getSampledNeighbors(rn *randomNeighbors, chordNeighb
}

func (localNode *LocalNode) GetGossipNeighbors(filter func(*node.RemoteNode) bool) []*node.RemoteNode {
return localNode.getSampledNeighbors(localNode.gossipNeighbors, config.GossipSampleChordNeighbor, config.GossipMinChordNeighbor, filter)
// we use all neighbors for gossip to minimize the chance of block proposal not propagating to all nodes when the majority of the network is falling behind
return localNode.GetNeighbors(filter)
// return localNode.getSampledNeighbors(localNode.gossipNeighbors, config.GossipSampleChordNeighbor, config.GossipMinChordNeighbor, filter)
}

func (localNode *LocalNode) GetVotingNeighbors(filter func(*node.RemoteNode) bool) []*node.RemoteNode {
Expand Down