swarm/network: Hive - do not notify peer if discovery is disabled

This commit is contained in:
Janos Guljas 2018-11-30 18:55:56 +01:00
parent 01371469e6
commit 6fbdcb27f0
2 changed files with 1 additions and 2 deletions

View file

@ -165,8 +165,8 @@ func (h *Hive) Run(p *BzzPeer) error {
// otherwise just send depth to new peer // otherwise just send depth to new peer
dp.NotifyDepth(depth) dp.NotifyDepth(depth)
} }
NotifyPeer(p.BzzAddr, h.Kademlia)
} }
NotifyPeer(p.BzzAddr, h.Kademlia)
defer h.Off(dp) defer h.Off(dp)
return dp.Run(dp.HandleMsg) return dp.Run(dp.HandleMsg)
} }

View file

@ -33,7 +33,6 @@ func TestWaitTillHealthy(t *testing.T) {
"bzz": func(ctx *adapters.ServiceContext, b *sync.Map) (node.Service, func(), error) { "bzz": func(ctx *adapters.ServiceContext, b *sync.Map) (node.Service, func(), error) {
addr := network.NewAddr(ctx.Config.Node()) addr := network.NewAddr(ctx.Config.Node())
hp := network.NewHiveParams() hp := network.NewHiveParams()
hp.Discovery = false
config := &network.BzzConfig{ config := &network.BzzConfig{
OverlayAddr: addr.Over(), OverlayAddr: addr.Over(),
UnderlayAddr: addr.Under(), UnderlayAddr: addr.Under(),