diff options
Diffstat (limited to 'eth/handler.go')
-rw-r--r-- | eth/handler.go | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/eth/handler.go b/eth/handler.go index bec5126dc..074cffd96 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -394,14 +394,14 @@ func (pm *ProtocolManager) handleMsg(p *peer) error { case query.Reverse: // Number based traversal towards the genesis block if query.Origin.Number >= query.Skip+1 { - query.Origin.Number -= (query.Skip + 1) + query.Origin.Number -= query.Skip + 1 } else { unknown = true } case !query.Reverse: // Number based traversal towards the leaf block - query.Origin.Number += (query.Skip + 1) + query.Origin.Number += query.Skip + 1 } } return p.SendBlockHeaders(headers) @@ -744,22 +744,24 @@ 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) - 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 - Head common.Hash `json:"head"` // SHA3 hash of the host's best owned block +// 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 + Head common.Hash `json:"head"` // SHA3 hash of the host's best owned block } // 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(), + Config: self.blockchain.Config(), Head: currentBlock.Hash(), } } |