aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-12-28 21:18:34 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-12-28 21:18:34 +0800
commitf7ca03ae875c7c78191bf38f6ce1cc4bbe5361c6 (patch)
tree20585ede9010cc0f7051c27e56cfd2d9a4fbfedb /eth
parentc15d76a40f330561b2491718a143fd494a2b7b5c (diff)
downloaddexon-f7ca03ae875c7c78191bf38f6ce1cc4bbe5361c6.tar
dexon-f7ca03ae875c7c78191bf38f6ce1cc4bbe5361c6.tar.gz
dexon-f7ca03ae875c7c78191bf38f6ce1cc4bbe5361c6.tar.bz2
dexon-f7ca03ae875c7c78191bf38f6ce1cc4bbe5361c6.tar.lz
dexon-f7ca03ae875c7c78191bf38f6ce1cc4bbe5361c6.tar.xz
dexon-f7ca03ae875c7c78191bf38f6ce1cc4bbe5361c6.tar.zst
dexon-f7ca03ae875c7c78191bf38f6ce1cc4bbe5361c6.zip
eth, les, light: expose chain config in les node info too (#15732)
Diffstat (limited to 'eth')
-rw-r--r--eth/handler.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/eth/handler.go b/eth/handler.go
index cd66662d8..31c311687 100644
--- a/eth/handler.go
+++ b/eth/handler.go
@@ -744,10 +744,10 @@ func (self *ProtocolManager) txBroadcastLoop() {
}
}
-// EthNodeInfo represents a short summary of the Ethereum sub-protocol metadata known
-// about the host peer.
-type EthNodeInfo struct {
- Network uint64 `json:"network"` // Ethereum network ID (1=Frontier, 2=Morden, Ropsten=3)
+// NodeInfo represents a short summary of the Ethereum sub-protocol metadata
+// known about the host peer.
+type NodeInfo struct {
+ Network uint64 `json:"network"` // Ethereum network ID (1=Frontier, 2=Morden, Ropsten=3, Rinkeby=4)
Difficulty *big.Int `json:"difficulty"` // Total difficulty of the host's blockchain
Genesis common.Hash `json:"genesis"` // SHA3 hash of the host's genesis block
Config *params.ChainConfig `json:"config"` // Chain configuration for the fork rules
@@ -755,9 +755,9 @@ type EthNodeInfo struct {
}
// NodeInfo retrieves some protocol metadata about the running host node.
-func (self *ProtocolManager) NodeInfo() *EthNodeInfo {
+func (self *ProtocolManager) NodeInfo() *NodeInfo {
currentBlock := self.blockchain.CurrentBlock()
- return &EthNodeInfo{
+ return &NodeInfo{
Network: self.networkId,
Difficulty: self.blockchain.GetTd(currentBlock.Hash(), currentBlock.NumberU64()),
Genesis: self.blockchain.Genesis().Hash(),