RPC shows Peer{Address,IsOutbound}
This commit is contained in:
parent
a9467414d6
commit
e0d6fd6bfa
|
@ -38,9 +38,12 @@ func NetInfo() (*ctypes.ResponseNetInfo, error) {
|
|||
for _, listener := range p2pSwitch.Listeners() {
|
||||
listeners = append(listeners, listener.String())
|
||||
}
|
||||
peers := []string{}
|
||||
peers := []ctypes.Peer{}
|
||||
for _, peer := range p2pSwitch.Peers().List() {
|
||||
peers = append(peers, peer.String())
|
||||
peers = append(peers, ctypes.Peer{
|
||||
Address: peer.Connection().RemoteAddress.String(),
|
||||
IsOutbound: peer.IsOutbound(),
|
||||
})
|
||||
}
|
||||
return &ctypes.ResponseNetInfo{
|
||||
Network: network,
|
||||
|
|
|
@ -73,7 +73,12 @@ type ResponseNetInfo struct {
|
|||
Network string
|
||||
Listening bool
|
||||
Listeners []string
|
||||
Peers []string
|
||||
Peers []Peer
|
||||
}
|
||||
|
||||
type Peer struct {
|
||||
Address string
|
||||
IsOutbound bool
|
||||
}
|
||||
|
||||
type ResponseSignTx struct {
|
||||
|
|
Loading…
Reference in New Issue