diff options
author | lash <nolash@users.noreply.github.com> | 2019-01-10 19:33:51 +0800 |
---|---|---|
committer | Viktor TrĂ³n <viktor.tron@gmail.com> | 2019-01-10 19:33:51 +0800 |
commit | 7240f4d800d3ffb97cf23a27d13746428d761cec (patch) | |
tree | 7a632be60e304e1aed98a826dc526df48c3a1c0e /swarm/network/simulation/simulation.go | |
parent | 7ca40306af9da68a0d31439117246de8247f99d6 (diff) | |
download | dexon-7240f4d800d3ffb97cf23a27d13746428d761cec.tar dexon-7240f4d800d3ffb97cf23a27d13746428d761cec.tar.gz dexon-7240f4d800d3ffb97cf23a27d13746428d761cec.tar.bz2 dexon-7240f4d800d3ffb97cf23a27d13746428d761cec.tar.lz dexon-7240f4d800d3ffb97cf23a27d13746428d761cec.tar.xz dexon-7240f4d800d3ffb97cf23a27d13746428d761cec.tar.zst dexon-7240f4d800d3ffb97cf23a27d13746428d761cec.zip |
swarm/network: Rename minproxbinsize, add as member of simulation (#18408)
* swarm/network: Rename minproxbinsize, add as member of simulation
* swarm/network: Deactivate WaitTillHealthy, unreliable pending suggestpeer
Diffstat (limited to 'swarm/network/simulation/simulation.go')
-rw-r--r-- | swarm/network/simulation/simulation.go | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/swarm/network/simulation/simulation.go b/swarm/network/simulation/simulation.go index 106eeb71e..13c5b1c57 100644 --- a/swarm/network/simulation/simulation.go +++ b/swarm/network/simulation/simulation.go @@ -28,6 +28,7 @@ import ( "github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/p2p/simulations" "github.com/ethereum/go-ethereum/p2p/simulations/adapters" + "github.com/ethereum/go-ethereum/swarm/network" ) // Common errors that are returned by functions in this package. @@ -42,13 +43,14 @@ type Simulation struct { // of p2p/simulations.Network. Net *simulations.Network - serviceNames []string - cleanupFuncs []func() - buckets map[enode.ID]*sync.Map - pivotNodeID *enode.ID - shutdownWG sync.WaitGroup - done chan struct{} - mu sync.RWMutex + serviceNames []string + cleanupFuncs []func() + buckets map[enode.ID]*sync.Map + pivotNodeID *enode.ID + shutdownWG sync.WaitGroup + done chan struct{} + mu sync.RWMutex + neighbourhoodSize int httpSrv *http.Server //attach a HTTP server via SimulationOptions handler *simulations.Server //HTTP handler for the server @@ -72,8 +74,9 @@ type ServiceFunc func(ctx *adapters.ServiceContext, bucket *sync.Map) (s node.Se // which is used to start node.Service returned by ServiceFunc. func New(services map[string]ServiceFunc) (s *Simulation) { s = &Simulation{ - buckets: make(map[enode.ID]*sync.Map), - done: make(chan struct{}), + buckets: make(map[enode.ID]*sync.Map), + done: make(chan struct{}), + neighbourhoodSize: network.NewKadParams().NeighbourhoodSize, } adapterServices := make(map[string]adapters.ServiceFunc, len(services)) |