Browse Source

rpc: include peer's remote IP in `/net_info` (#3052)

Refs #3047
breaking
Anton Kaliaev 6 years ago
committed by Ethan Buchman
parent
commit
81c51cd4fc
3 changed files with 4 additions and 0 deletions
  1. +1
    -0
      CHANGELOG_PENDING.md
  2. +1
    -0
      rpc/core/net.go
  3. +2
    -0
      rpc/core/types/responses.go

+ 1
- 0
CHANGELOG_PENDING.md View File

@ -29,6 +29,7 @@ Special thanks to external contributors on this release:
- [privval] \#1181 Split immutable and mutable parts of priv_validator.json - [privval] \#1181 Split immutable and mutable parts of priv_validator.json
### IMPROVEMENTS: ### IMPROVEMENTS:
- [rpc] \#3047 Include peer's remote IP in `/net_info`
### BUG FIXES: ### BUG FIXES:
- [types] \#2926 do not panic if retrieving the private validator's public key fails - [types] \#2926 do not panic if retrieving the private validator's public key fails


+ 1
- 0
rpc/core/net.go View File

@ -53,6 +53,7 @@ func NetInfo() (*ctypes.ResultNetInfo, error) {
NodeInfo: nodeInfo, NodeInfo: nodeInfo,
IsOutbound: peer.IsOutbound(), IsOutbound: peer.IsOutbound(),
ConnectionStatus: peer.Status(), ConnectionStatus: peer.Status(),
RemoteIP: peer.RemoteIP(),
}) })
} }
// TODO: Should we include PersistentPeers and Seeds in here? // TODO: Should we include PersistentPeers and Seeds in here?


+ 2
- 0
rpc/core/types/responses.go View File

@ -2,6 +2,7 @@ package core_types
import ( import (
"encoding/json" "encoding/json"
"net"
"time" "time"
abci "github.com/tendermint/tendermint/abci/types" abci "github.com/tendermint/tendermint/abci/types"
@ -110,6 +111,7 @@ type Peer struct {
NodeInfo p2p.DefaultNodeInfo `json:"node_info"` NodeInfo p2p.DefaultNodeInfo `json:"node_info"`
IsOutbound bool `json:"is_outbound"` IsOutbound bool `json:"is_outbound"`
ConnectionStatus p2p.ConnectionStatus `json:"connection_status"` ConnectionStatus p2p.ConnectionStatus `json:"connection_status"`
RemoteIP net.IP `json:"remote_ip"`
} }
// Validators for a height // Validators for a height


Loading…
Cancel
Save