Skip to content

Commit

Permalink
rpc: include peer's remote IP in /net_info (#3052)
Browse files Browse the repository at this point in the history
Refs #3047
  • Loading branch information
melekes authored and ebuchman committed Jan 11, 2019
1 parent 51094f9 commit 81c51cd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Special thanks to external contributors on this release:
- [privval] \#1181 Split immutable and mutable parts of priv_validator.json

### IMPROVEMENTS:
- [rpc] \#3047 Include peer's remote IP in `/net_info`

### BUG FIXES:
- [types] \#2926 do not panic if retrieving the private validator's public key fails
Expand Down
1 change: 1 addition & 0 deletions rpc/core/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func NetInfo() (*ctypes.ResultNetInfo, error) {
NodeInfo: nodeInfo,
IsOutbound: peer.IsOutbound(),
ConnectionStatus: peer.Status(),
RemoteIP: peer.RemoteIP(),
})
}
// TODO: Should we include PersistentPeers and Seeds in here?
Expand Down
2 changes: 2 additions & 0 deletions rpc/core/types/responses.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package core_types

import (
"encoding/json"
"net"
"time"

abci "github.com/tendermint/tendermint/abci/types"
Expand Down Expand Up @@ -110,6 +111,7 @@ type Peer struct {
NodeInfo p2p.DefaultNodeInfo `json:"node_info"`
IsOutbound bool `json:"is_outbound"`
ConnectionStatus p2p.ConnectionStatus `json:"connection_status"`
RemoteIP net.IP `json:"remote_ip"`
}

// Validators for a height
Expand Down

0 comments on commit 81c51cd

Please sign in to comment.