mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
swarm/network: WIP consider all nodes for healthy iteration
This commit is contained in:
parent
c8da76e63d
commit
fb7d896502
1 changed files with 3 additions and 2 deletions
|
|
@ -70,7 +70,7 @@ func (s *Simulation) WaitTillHealthy(ctx context.Context) (ill map[enode.ID]*net
|
||||||
log.Debug("kademlia", "connectNN", h.ConnectNN, "knowNN", h.KnowNN)
|
log.Debug("kademlia", "connectNN", h.ConnectNN, "knowNN", h.KnowNN)
|
||||||
log.Debug("kademlia", "health", h.ConnectNN && h.KnowNN, "addr", hex.EncodeToString(k.BaseAddr()), "node", id)
|
log.Debug("kademlia", "health", h.ConnectNN && h.KnowNN, "addr", hex.EncodeToString(k.BaseAddr()), "node", id)
|
||||||
log.Debug("kademlia", "ill condition", !h.ConnectNN, "addr", hex.EncodeToString(k.BaseAddr()), "node", id)
|
log.Debug("kademlia", "ill condition", !h.ConnectNN, "addr", hex.EncodeToString(k.BaseAddr()), "node", id)
|
||||||
if !h.ConnectNN {
|
if !h.Healthy() {
|
||||||
ill[id] = k
|
ill[id] = k
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -84,7 +84,8 @@ func (s *Simulation) WaitTillHealthy(ctx context.Context) (ill map[enode.ID]*net
|
||||||
// kademlias returns all Kademlia instances that are set
|
// kademlias returns all Kademlia instances that are set
|
||||||
// in simulation bucket.
|
// in simulation bucket.
|
||||||
func (s *Simulation) kademlias() (ks map[enode.ID]*network.Kademlia) {
|
func (s *Simulation) kademlias() (ks map[enode.ID]*network.Kademlia) {
|
||||||
items := s.UpNodesItems(BucketKeyKademlia)
|
//items := s.UpNodesItems(BucketKeyKademlia)
|
||||||
|
items := s.NodesItems(BucketKeyKademlia)
|
||||||
ks = make(map[enode.ID]*network.Kademlia, len(items))
|
ks = make(map[enode.ID]*network.Kademlia, len(items))
|
||||||
for id, v := range items {
|
for id, v := range items {
|
||||||
k, ok := v.(*network.Kademlia)
|
k, ok := v.(*network.Kademlia)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue