mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-25 10:41:41 +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() {
|
for _, listener := range p2pSwitch.Listeners() {
|
||||||
listeners = append(listeners, listener.String())
|
listeners = append(listeners, listener.String())
|
||||||
}
|
}
|
||||||
peers := []string{}
|
peers := []ctypes.Peer{}
|
||||||
for _, peer := range p2pSwitch.Peers().List() {
|
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{
|
return &ctypes.ResponseNetInfo{
|
||||||
Network: network,
|
Network: network,
|
||||||
|
@ -73,7 +73,12 @@ type ResponseNetInfo struct {
|
|||||||
Network string
|
Network string
|
||||||
Listening bool
|
Listening bool
|
||||||
Listeners []string
|
Listeners []string
|
||||||
Peers []string
|
Peers []Peer
|
||||||
|
}
|
||||||
|
|
||||||
|
type Peer struct {
|
||||||
|
Address string
|
||||||
|
IsOutbound bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type ResponseSignTx struct {
|
type ResponseSignTx struct {
|
||||||
|
Reference in New Issue
Block a user