Skip to content

Commit 4c23fe9

Browse files
authoredMar 6, 2023
eth: remove admin.peers[i].eth.head and difficulty (ethereum#26804)
1 parent d865a5d commit 4c23fe9

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed
 

‎eth/peer.go

+2-10
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,14 @@
1717
package eth
1818

1919
import (
20-
"math/big"
21-
2220
"github.com/ethereum/go-ethereum/eth/protocols/eth"
2321
"github.com/ethereum/go-ethereum/eth/protocols/snap"
2422
)
2523

2624
// ethPeerInfo represents a short summary of the `eth` sub-protocol metadata known
2725
// about a connected peer.
2826
type ethPeerInfo struct {
29-
Version uint `json:"version"` // Ethereum protocol version negotiated
30-
Difficulty *big.Int `json:"difficulty"` // Total difficulty of the peer's blockchain
31-
Head string `json:"head"` // Hex hash of the peer's best owned block
27+
Version uint `json:"version"` // Ethereum protocol version negotiated
3228
}
3329

3430
// ethPeer is a wrapper around eth.Peer to maintain a few extra metadata.
@@ -39,12 +35,8 @@ type ethPeer struct {
3935

4036
// info gathers and returns some `eth` protocol metadata known about a peer.
4137
func (p *ethPeer) info() *ethPeerInfo {
42-
hash, td := p.Head()
43-
4438
return &ethPeerInfo{
45-
Version: p.Version(),
46-
Difficulty: td,
47-
Head: hash.Hex(),
39+
Version: p.Version(),
4840
}
4941
}
5042

0 commit comments

Comments
 (0)