mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-10 20:01:20 +00:00
Include p2p connection status in RPC net_info
This commit is contained in:
@ -15,8 +15,9 @@ func NetInfo() (*ctypes.ResultNetInfo, error) {
|
||||
peers := []ctypes.Peer{}
|
||||
for _, peer := range p2pSwitch.Peers().List() {
|
||||
peers = append(peers, ctypes.Peer{
|
||||
NodeInfo: *peer.NodeInfo,
|
||||
IsOutbound: peer.IsOutbound(),
|
||||
NodeInfo: *peer.NodeInfo,
|
||||
IsOutbound: peer.IsOutbound(),
|
||||
ConnectionStatus: peer.Connection().Status(),
|
||||
})
|
||||
}
|
||||
return &ctypes.ResultNetInfo{
|
||||
|
@ -38,8 +38,9 @@ type ResultNetInfo struct {
|
||||
}
|
||||
|
||||
type Peer struct {
|
||||
p2p.NodeInfo `json:"node_info"`
|
||||
IsOutbound bool `json:"is_outbound"`
|
||||
p2p.NodeInfo `json:"node_info"`
|
||||
IsOutbound bool `json:"is_outbound"`
|
||||
ConnectionStatus p2p.ConnectionStatus `json:"connection_status"`
|
||||
}
|
||||
|
||||
type ResultListValidators struct {
|
||||
|
Reference in New Issue
Block a user