aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/network
diff options
context:
space:
mode:
authorJanoš Guljaš <janos@users.noreply.github.com>2018-12-07 13:51:40 +0800
committerViktor Trón <viktor.tron@gmail.com>2018-12-07 13:51:40 +0800
commit661809714e35f69dea23f713dd1e65cff523344c (patch)
treeb069e61a5140ad71389570674382f8ced0261cc5 /swarm/network
parentde39513ced05f120b30b0daa49003982cc6b2426 (diff)
downloaddexon-661809714e35f69dea23f713dd1e65cff523344c.tar
dexon-661809714e35f69dea23f713dd1e65cff523344c.tar.gz
dexon-661809714e35f69dea23f713dd1e65cff523344c.tar.bz2
dexon-661809714e35f69dea23f713dd1e65cff523344c.tar.lz
dexon-661809714e35f69dea23f713dd1e65cff523344c.tar.xz
dexon-661809714e35f69dea23f713dd1e65cff523344c.tar.zst
dexon-661809714e35f69dea23f713dd1e65cff523344c.zip
swarm: snapshot load improvement (#18220)
* swarm/network: Hive - do not notify peer if discovery is disabled * p2p/simulations: validate all connections on loading a snapshot * p2p/simulations: track all connections in on snapshot loading * p2p/simulations: add snapshotLoadTimeout variable * p2p/simulations: ignore control events in snapshot load * p2p/simulations: simplify event loop synchronization * p2p/simulations: return already connected error from Load function * p2p/simulations: log warning on snapshot loading disconnection
Diffstat (limited to 'swarm/network')
-rw-r--r--swarm/network/hive.go2
-rw-r--r--swarm/network/simulation/kademlia_test.go1
2 files changed, 1 insertions, 2 deletions
diff --git a/swarm/network/hive.go b/swarm/network/hive.go
index 1aa1ae42a..ebef54592 100644
--- a/swarm/network/hive.go
+++ b/swarm/network/hive.go
@@ -165,8 +165,8 @@ func (h *Hive) Run(p *BzzPeer) error {
// otherwise just send depth to new peer
dp.NotifyDepth(depth)
}
+ NotifyPeer(p.BzzAddr, h.Kademlia)
}
- NotifyPeer(p.BzzAddr, h.Kademlia)
defer h.Off(dp)
return dp.Run(dp.HandleMsg)
}
diff --git a/swarm/network/simulation/kademlia_test.go b/swarm/network/simulation/kademlia_test.go
index 024830315..f02b0e541 100644
--- a/swarm/network/simulation/kademlia_test.go
+++ b/swarm/network/simulation/kademlia_test.go
@@ -33,7 +33,6 @@ func TestWaitTillHealthy(t *testing.T) {
"bzz": func(ctx *adapters.ServiceContext, b *sync.Map) (node.Service, func(), error) {
addr := network.NewAddr(ctx.Config.Node())
hp := network.NewHiveParams()
- hp.Discovery = false
config := &network.BzzConfig{
OverlayAddr: addr.Over(),
UnderlayAddr: addr.Under(),