mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-13 13:21: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{}
|
peers := []ctypes.Peer{}
|
||||||
for _, peer := range p2pSwitch.Peers().List() {
|
for _, peer := range p2pSwitch.Peers().List() {
|
||||||
peers = append(peers, ctypes.Peer{
|
peers = append(peers, ctypes.Peer{
|
||||||
NodeInfo: *peer.NodeInfo,
|
NodeInfo: *peer.NodeInfo,
|
||||||
IsOutbound: peer.IsOutbound(),
|
IsOutbound: peer.IsOutbound(),
|
||||||
|
ConnectionStatus: peer.Connection().Status(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return &ctypes.ResultNetInfo{
|
return &ctypes.ResultNetInfo{
|
||||||
|
@ -38,8 +38,9 @@ type ResultNetInfo struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Peer struct {
|
type Peer struct {
|
||||||
p2p.NodeInfo `json:"node_info"`
|
p2p.NodeInfo `json:"node_info"`
|
||||||
IsOutbound bool `json:"is_outbound"`
|
IsOutbound bool `json:"is_outbound"`
|
||||||
|
ConnectionStatus p2p.ConnectionStatus `json:"connection_status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ResultListValidators struct {
|
type ResultListValidators struct {
|
||||||
|
Reference in New Issue
Block a user