network: broadcast to log-dependent number of nodes

Fixes #608.
This commit is contained in:
Roman Khimov 2022-10-12 22:57:49 +03:00
parent dc62046019
commit 631f166709
4 changed files with 30 additions and 5 deletions

View file

@ -40,6 +40,11 @@ func (d *testDiscovery) RegisterBadAddr(addr string) {
defer d.Unlock()
d.bad = append(d.bad, addr)
}
func (d *testDiscovery) GetFanOut() int {
d.Lock()
defer d.Unlock()
return len(d.connected) + len(d.backfill)
}
func (d *testDiscovery) RegisterGoodAddr(string, capability.Capabilities) {}
func (d *testDiscovery) RegisterConnectedAddr(addr string) {
d.Lock()