ethstats: report block miner, gas limit and gas consumption

pull/3370/head
Péter Szilágyi 8 years ago
parent 61ccb43487
commit 7625b1a4f4
No known key found for this signature in database
GPG Key ID: 119A76381CCB7DD2
  1. 6
      ethstats/ethstats.go

@ -294,6 +294,9 @@ func (s *Service) reportLatency(in *json.Decoder, out *json.Encoder) error {
type blockStats struct {
Number *big.Int `json:"number"`
Hash common.Hash `json:"hash"`
Miner common.Address `json:"miner"`
GasUsed *big.Int `json:"gasUsed"`
GasLimit *big.Int `json:"gasLimit"`
Diff string `json:"difficulty"`
TotalDiff string `json:"totalDifficulty"`
Txs txStats `json:"transactions"`
@ -351,6 +354,9 @@ func (s *Service) reportBlock(out *json.Encoder) error {
"block": &blockStats{
Number: head.Number,
Hash: head.Hash(),
Miner: head.Coinbase,
GasUsed: new(big.Int).Set(head.GasUsed),
GasLimit: new(big.Int).Set(head.GasLimit),
Diff: head.Difficulty.String(),
TotalDiff: td.String(),
Txs: txs,

Loading…
Cancel
Save