From 4c23fe97c5472f2c0a6c89fcf4e459316110fb0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Mon, 6 Mar 2023 09:27:46 +0200 Subject: [PATCH] eth: remove admin.peers[i].eth.head and difficulty (#26804) --- eth/peer.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/eth/peer.go b/eth/peer.go index 55e5f0046..761877771 100644 --- a/eth/peer.go +++ b/eth/peer.go @@ -17,8 +17,6 @@ package eth import ( - "math/big" - "github.com/ethereum/go-ethereum/eth/protocols/eth" "github.com/ethereum/go-ethereum/eth/protocols/snap" ) @@ -26,9 +24,7 @@ import ( // ethPeerInfo represents a short summary of the `eth` sub-protocol metadata known // about a connected peer. type ethPeerInfo struct { - Version uint `json:"version"` // Ethereum protocol version negotiated - Difficulty *big.Int `json:"difficulty"` // Total difficulty of the peer's blockchain - Head string `json:"head"` // Hex hash of the peer's best owned block + Version uint `json:"version"` // Ethereum protocol version negotiated } // ethPeer is a wrapper around eth.Peer to maintain a few extra metadata. @@ -39,12 +35,8 @@ type ethPeer struct { // info gathers and returns some `eth` protocol metadata known about a peer. func (p *ethPeer) info() *ethPeerInfo { - hash, td := p.Head() - return ðPeerInfo{ - Version: p.Version(), - Difficulty: td, - Head: hash.Hex(), + Version: p.Version(), } }