1. moved address to core

This commit is contained in:
vadym 2022-10-30 21:58:42 +02:00
parent b5f79eadcb
commit 6319d6231b
15 changed files with 61 additions and 60 deletions

View file

@ -6,7 +6,7 @@ import (
"sort"
"strings"
"github.com/RiV-chain/RiV-mesh/src/address"
//"github.com/RiV-chain/RiV-mesh/src/address"
)
type GetDHTRequest struct{}
@ -26,7 +26,7 @@ func (a *AdminSocket) getDHTHandler(req *GetDHTRequest, res *GetDHTResponse) err
dht := a.core.GetDHT()
res.DHT = make([]DHTEntry, 0, len(dht))
for _, d := range dht {
addr := address.AddrForKey(d.Key)
addr := a.core.AddrForKey(d.Key)
res.DHT = append(res.DHT, DHTEntry{
IPAddress: net.IP(addr[:]).String(),
PublicKey: hex.EncodeToString(d.Key[:]),

View file

@ -6,7 +6,7 @@ import (
"sort"
"strings"
"github.com/RiV-chain/RiV-mesh/src/address"
//"github.com/RiV-chain/RiV-mesh/src/address"
)
type GetPathsRequest struct {
@ -26,7 +26,7 @@ func (a *AdminSocket) getPathsHandler(req *GetPathsRequest, res *GetPathsRespons
paths := a.core.GetPaths()
res.Paths = make([]PathEntry, 0, len(paths))
for _, p := range paths {
addr := address.AddrForKey(p.Key)
addr := a.core.AddrForKey(p.Key)
res.Paths = append(res.Paths, PathEntry{
IPAddress: net.IP(addr[:]).String(),
PublicKey: hex.EncodeToString(p.Key),

View file

@ -5,7 +5,7 @@ import (
"net"
"sort"
"github.com/RiV-chain/RiV-mesh/src/address"
//"github.com/RiV-chain/RiV-mesh/src/address"
)
type GetPeersRequest struct {
@ -31,7 +31,7 @@ func (a *AdminSocket) getPeersHandler(req *GetPeersRequest, res *GetPeersRespons
peers := a.core.GetPeers()
res.Peers = make([]PeerEntry, 0, len(peers))
for _, p := range peers {
addr := address.AddrForKey(p.Key)
addr := a.core.AddrForKey(p.Key)
res.Peers = append(res.Peers, PeerEntry{
IPAddress: net.IP(addr[:]).String(),
PublicKey: hex.EncodeToString(p.Key),

View file

@ -6,7 +6,7 @@ import (
"sort"
"strings"
"github.com/RiV-chain/RiV-mesh/src/address"
//"github.com/RiV-chain/RiV-mesh/src/address"
)
type GetSessionsRequest struct{}
@ -27,7 +27,7 @@ func (a *AdminSocket) getSessionsHandler(req *GetSessionsRequest, res *GetSessio
sessions := a.core.GetSessions()
res.Sessions = make([]SessionEntry, 0, len(sessions))
for _, s := range sessions {
addr := address.AddrForKey(s.Key)
addr := a.core.AddrForKey(s.Key)
res.Sessions = append(res.Sessions, SessionEntry{
IPAddress: net.IP(addr[:]).String(),
PublicKey: hex.EncodeToString(s.Key[:]),