Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jan 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Special thanks to external contributors on this release:
### FEATURES:

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

### BUG FIXES:

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