diff options
Diffstat (limited to 'ethstats/ethstats.go')
-rw-r--r-- | ethstats/ethstats.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ethstats/ethstats.go b/ethstats/ethstats.go index 7065d7162..ae7e25265 100644 --- a/ethstats/ethstats.go +++ b/ethstats/ethstats.go @@ -374,10 +374,10 @@ func (s *Service) login(conn *websocket.Conn) error { var network, protocol string if info := infos.Protocols["eth"]; info != nil { - network = fmt.Sprintf("%d", info.(*eth.EthNodeInfo).Network) + network = fmt.Sprintf("%d", info.(*eth.NodeInfo).Network) protocol = fmt.Sprintf("eth/%d", eth.ProtocolVersions[0]) } else { - network = fmt.Sprintf("%d", infos.Protocols["les"].(*eth.EthNodeInfo).Network) + network = fmt.Sprintf("%d", infos.Protocols["les"].(*les.NodeInfo).Network) protocol = fmt.Sprintf("les/%d", les.ClientProtocolVersions[0]) } auth := &authMsg{ @@ -473,8 +473,8 @@ type blockStats struct { ParentHash common.Hash `json:"parentHash"` Timestamp *big.Int `json:"timestamp"` Miner common.Address `json:"miner"` - GasUsed *big.Int `json:"gasUsed"` - GasLimit *big.Int `json:"gasLimit"` + GasUsed uint64 `json:"gasUsed"` + GasLimit uint64 `json:"gasLimit"` Diff string `json:"difficulty"` TotalDiff string `json:"totalDifficulty"` Txs []txStats `json:"transactions"` @@ -559,8 +559,8 @@ func (s *Service) assembleBlockStats(block *types.Block) *blockStats { ParentHash: header.ParentHash, Timestamp: header.Time, Miner: author, - GasUsed: new(big.Int).Set(header.GasUsed), - GasLimit: new(big.Int).Set(header.GasLimit), + GasUsed: header.GasUsed, + GasLimit: header.GasLimit, Diff: header.Difficulty.String(), TotalDiff: td.String(), Txs: txs, @@ -613,6 +613,7 @@ func (s *Service) reportHistory(conn *websocket.Conn, list []uint64) error { } // Ran out of blocks, cut the report short and send history = history[len(history)-i:] + break } // Assemble the history report and send it to the server if len(history) > 0 { |