mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-24 10:11:48 +00:00
RPC shows Peer{Address,IsOutbound}
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user