aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/network/simulation/kademlia.go
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/network/simulation/kademlia.go')
-rw-r--r--swarm/network/simulation/kademlia.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/swarm/network/simulation/kademlia.go b/swarm/network/simulation/kademlia.go
index 3e45cb0ce..f895181d9 100644
--- a/swarm/network/simulation/kademlia.go
+++ b/swarm/network/simulation/kademlia.go
@@ -21,10 +21,9 @@ import (
"encoding/hex"
"time"
- "github.com/ethereum/go-ethereum/p2p/discover"
-
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
+ "github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/swarm/network"
)
@@ -34,7 +33,7 @@ var BucketKeyKademlia BucketKey = "kademlia"
// WaitTillHealthy is blocking until the health of all kademlias is true.
// If error is not nil, a map of kademlia that was found not healthy is returned.
-func (s *Simulation) WaitTillHealthy(ctx context.Context, kadMinProxSize int) (ill map[discover.NodeID]*network.Kademlia, err error) {
+func (s *Simulation) WaitTillHealthy(ctx context.Context, kadMinProxSize int) (ill map[enode.ID]*network.Kademlia, err error) {
// Prepare PeerPot map for checking Kademlia health
var ppmap map[string]*network.PeerPot
kademlias := s.kademlias()
@@ -48,7 +47,7 @@ func (s *Simulation) WaitTillHealthy(ctx context.Context, kadMinProxSize int) (i
ticker := time.NewTicker(200 * time.Millisecond)
defer ticker.Stop()
- ill = make(map[discover.NodeID]*network.Kademlia)
+ ill = make(map[enode.ID]*network.Kademlia)
for {
select {
case <-ctx.Done():
@@ -82,9 +81,9 @@ func (s *Simulation) WaitTillHealthy(ctx context.Context, kadMinProxSize int) (i
// kademlias returns all Kademlia instances that are set
// in simulation bucket.
-func (s *Simulation) kademlias() (ks map[discover.NodeID]*network.Kademlia) {
+func (s *Simulation) kademlias() (ks map[enode.ID]*network.Kademlia) {
items := s.UpNodesItems(BucketKeyKademlia)
- ks = make(map[discover.NodeID]*network.Kademlia, len(items))
+ ks = make(map[enode.ID]*network.Kademlia, len(items))
for id, v := range items {
k, ok := v.(*network.Kademlia)
if !ok {