mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
swarm/network: Change hive Healthy func to accept addresses
This commit is contained in:
parent
5bf8307719
commit
166f08403a
2 changed files with 8 additions and 4 deletions
|
|
@ -244,7 +244,10 @@ func (h *Hive) savePeers() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Healthy is an api proxy to the underlying kademlia healthy function
|
// Healthy is an api proxy to the underlying kademlia healthy function
|
||||||
func (h *Hive) Healthy(addr []byte, pp PeerPot) *Health {
|
func (h *Hive) Healthy(addrs [][]byte) *Health {
|
||||||
pp.base = addr
|
k := NewKademlia(h.BaseAddr(), NewKadParams())
|
||||||
return pp.Healthy()
|
for _, a := range addrs {
|
||||||
|
k.On(a)
|
||||||
|
}
|
||||||
|
return pp.Healthy([]*Kademlia{k})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -412,7 +412,8 @@ func discoveryPersistenceSimulation(nodes, conns int, adapter adapters.NodeAdapt
|
||||||
addr := id.String()
|
addr := id.String()
|
||||||
log.Error("before hive healthy call")
|
log.Error("before hive healthy call")
|
||||||
pp := ppmap[addr]
|
pp := ppmap[addr]
|
||||||
if err := client.Call(&healthy, "hive_healthy", pp.BaseAddr(), pp); err != nil {
|
// if err := client.Call(&healthy, "hive_healthy", pp.BaseAddr(), pp); err != nil {
|
||||||
|
if err := client.Call(&healthy, "hive_healthy", pp.BaseAddr(), addrs); err != nil {
|
||||||
return fmt.Errorf("error getting node health: %s", err)
|
return fmt.Errorf("error getting node health: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue