cmd/swarm/swarm-snapshot: swarm snapshot generator (#18453)
* cmd/swarm/swarm-snapshot: add binary to create network snapshots * cmd/swarm/swarm-snapshot: refactor and extend tests * p2p/simulations: remove unused triggerChecks func and fix linter * internal/cmdtest: raise the timeout for killing TestCmd * cmd/swarm/swarm-snapshot: add more comments and other minor adjustments * cmd/swarm/swarm-snapshot: remove redundant check in createSnapshot * cmd/swarm/swarm-snapshot: change comment wording * p2p/simulations: revert Simulation.Run from master https://github.com/ethersphere/go-ethereum/pull/1077/files#r247078904 * cmd/swarm/swarm-snapshot: address pr comments * swarm/network/simulations/discovery: removed snapshot write to file * cmd/swarm/swarm-snapshot, swarm/network/simulations: removed redundant connection event check, fixed lint error
This commit is contained in:
@@ -640,6 +640,8 @@ func (k *Kademlia) saturation() int {
|
||||
})
|
||||
// TODO evaluate whether this check cannot just as well be done within the eachbin
|
||||
depth := depthForPot(k.conns, k.NeighbourhoodSize, k.base)
|
||||
|
||||
// if in the iterator above we iterated deeper than the neighbourhood depth - return depth
|
||||
if depth < prev {
|
||||
return depth
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user