aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/network/simulations/overlay.go
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/network/simulations/overlay.go')
-rw-r--r--swarm/network/simulations/overlay.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/swarm/network/simulations/overlay.go b/swarm/network/simulations/overlay.go
index 9419de0c6..caf7ff1f2 100644
--- a/swarm/network/simulations/overlay.go
+++ b/swarm/network/simulations/overlay.go
@@ -29,7 +29,7 @@ import (
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/node"
- "github.com/ethereum/go-ethereum/p2p/discover"
+ "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"
@@ -64,26 +64,26 @@ func init() {
type Simulation struct {
mtx sync.Mutex
- stores map[discover.NodeID]*state.InmemoryStore
+ stores map[enode.ID]*state.InmemoryStore
}
func NewSimulation() *Simulation {
return &Simulation{
- stores: make(map[discover.NodeID]*state.InmemoryStore),
+ stores: make(map[enode.ID]*state.InmemoryStore),
}
}
func (s *Simulation) NewService(ctx *adapters.ServiceContext) (node.Service, error) {
- id := ctx.Config.ID
+ node := ctx.Config.Node()
s.mtx.Lock()
- store, ok := s.stores[id]
+ store, ok := s.stores[node.ID()]
if !ok {
store = state.NewInmemoryStore()
- s.stores[id] = store
+ s.stores[node.ID()] = store
}
s.mtx.Unlock()
- addr := network.NewAddrFromNodeID(id)
+ addr := network.NewAddr(node)
kp := network.NewKadParams()
kp.MinProxBinSize = 2