Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
7625b1a4
Unverified
Commit
7625b1a4
authored
Nov 29, 2016
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ethstats: report block miner, gas limit and gas consumption
parent
61ccb434
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
ethstats.go
ethstats/ethstats.go
+12
-6
No files found.
ethstats/ethstats.go
View file @
7625b1a4
...
@@ -292,12 +292,15 @@ func (s *Service) reportLatency(in *json.Decoder, out *json.Encoder) error {
...
@@ -292,12 +292,15 @@ func (s *Service) reportLatency(in *json.Decoder, out *json.Encoder) error {
// blockStats is the information to report about individual blocks.
// blockStats is the information to report about individual blocks.
type
blockStats
struct
{
type
blockStats
struct
{
Number
*
big
.
Int
`json:"number"`
Number
*
big
.
Int
`json:"number"`
Hash
common
.
Hash
`json:"hash"`
Hash
common
.
Hash
`json:"hash"`
Diff
string
`json:"difficulty"`
Miner
common
.
Address
`json:"miner"`
TotalDiff
string
`json:"totalDifficulty"`
GasUsed
*
big
.
Int
`json:"gasUsed"`
Txs
txStats
`json:"transactions"`
GasLimit
*
big
.
Int
`json:"gasLimit"`
Uncles
uncleStats
`json:"uncles"`
Diff
string
`json:"difficulty"`
TotalDiff
string
`json:"totalDifficulty"`
Txs
txStats
`json:"transactions"`
Uncles
uncleStats
`json:"uncles"`
}
}
// txStats is a custom wrapper around a transaction array to force serializing
// txStats is a custom wrapper around a transaction array to force serializing
...
@@ -351,6 +354,9 @@ func (s *Service) reportBlock(out *json.Encoder) error {
...
@@ -351,6 +354,9 @@ func (s *Service) reportBlock(out *json.Encoder) error {
"block"
:
&
blockStats
{
"block"
:
&
blockStats
{
Number
:
head
.
Number
,
Number
:
head
.
Number
,
Hash
:
head
.
Hash
(),
Hash
:
head
.
Hash
(),
Miner
:
head
.
Coinbase
,
GasUsed
:
new
(
big
.
Int
)
.
Set
(
head
.
GasUsed
),
GasLimit
:
new
(
big
.
Int
)
.
Set
(
head
.
GasLimit
),
Diff
:
head
.
Difficulty
.
String
(),
Diff
:
head
.
Difficulty
.
String
(),
TotalDiff
:
td
.
String
(),
TotalDiff
:
td
.
String
(),
Txs
:
txs
,
Txs
:
txs
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment