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
|
||||
func (h *Hive) Healthy(addr []byte, pp PeerPot) *Health {
|
||||
pp.base = addr
|
||||
return pp.Healthy()
|
||||
func (h *Hive) Healthy(addrs [][]byte) *Health {
|
||||
k := NewKademlia(h.BaseAddr(), NewKadParams())
|
||||
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()
|
||||
log.Error("before hive healthy call")
|
||||
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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue