diff options
Diffstat (limited to 'swarm/api')
-rw-r--r-- | swarm/api/inspector.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/swarm/api/inspector.go b/swarm/api/inspector.go index 6706b32e6..ea3c4c049 100644 --- a/swarm/api/inspector.go +++ b/swarm/api/inspector.go @@ -18,6 +18,7 @@ package api import ( "context" + "fmt" "github.com/ethereum/go-ethereum/swarm/network" "github.com/ethereum/go-ethereum/swarm/storage" @@ -38,6 +39,14 @@ func (inspector *Inspector) Hive() string { return inspector.hive.String() } +func (inspector *Inspector) ListKnown() []string { + res := []string{} + for _, v := range inspector.hive.Kademlia.ListKnown() { + res = append(res, fmt.Sprintf("%v", v)) + } + return res +} + type HasInfo struct { Addr string `json:"address"` Has bool `json:"has"` |