swarm: enable p2p/discovery and disable dynamic dialling (#19189)

This commit is contained in:
Anton Evangelatov
2019-03-01 12:20:37 +01:00
committed by GitHub
parent 94eca08ad8
commit 4e9230ea7a
3 changed files with 37 additions and 3 deletions

View File

@ -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"`