Skip to content

Commit

Permalink
Revert "p2p: add ENR to PeerInfo (ethereum#19816)"
Browse files Browse the repository at this point in the history
This reverts commit 41fa412.
  • Loading branch information
wanwiset25 committed Aug 23, 2024
1 parent 63a08e5 commit c88e7ab
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions p2p/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,9 @@ func (rw *protoRW) ReadMsg() (Msg, error) {
// peer. Sub-protocol independent fields are contained and initialized here, with
// protocol specifics delegated to all connected sub-protocols.
type PeerInfo struct {
ENR string `json:"enr,omitempty"` // Ethereum Node Record
Enode string `json:"enode"` // Node URL
ID string `json:"id"` // Unique node identifier
Name string `json:"name"` // Name of the node, including client type, version, OS, custom data
Caps []string `json:"caps"` // Protocols advertised by this peer
ID string `json:"id"` // Unique node identifier (also the encryption key)
Name string `json:"name"` // Name of the node, including client type, version, OS, custom data
Caps []string `json:"caps"` // Sum-protocols advertised by this particular peer
Network struct {
LocalAddress string `json:"localAddress"` // Local endpoint of the TCP data connection
RemoteAddress string `json:"remoteAddress"` // Remote endpoint of the TCP data connection
Expand All @@ -465,15 +463,11 @@ func (p *Peer) Info() *PeerInfo {
}
// Assemble the generic peer metadata
info := &PeerInfo{
Enode: p.Node().String(),
ID: p.ID().String(),
Name: p.Name(),
Caps: caps,
Protocols: make(map[string]interface{}),
}
if p.Node().Seq() > 0 {
info.ENR = p.Node().String()
}
info.Network.LocalAddress = p.LocalAddr().String()
info.Network.RemoteAddress = p.RemoteAddr().String()
info.Network.Inbound = p.rw.is(inboundConn)
Expand Down

0 comments on commit c88e7ab

Please sign in to comment.