Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
consensus/clique: fix struct tags for status API (ethereum#20316)
Browse files Browse the repository at this point in the history
Also unexport the status struct.
  • Loading branch information
fjl authored and elizabethengelman committed Dec 20, 2019
1 parent 2bd68c3 commit 308a5b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions consensus/clique/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,17 @@ func (api *API) Discard(address common.Address) {
delete(api.clique.proposals, address)
}

type Status struct {
type status struct {
InturnPercent float64 `json:"inturnPercent"`
SigningStatus map[common.Address]int `json:"sealerActivity""`
SigningStatus map[common.Address]int `json:"sealerActivity"`
NumBlocks uint64 `json:"numBlocks"`
}

// Status returns the status of the last N blocks,
// - the number of active signers,
// - the number of signers,
// - the percentage of in-turn blocks
func (api *API) Status() (*Status, error) {
func (api *API) Status() (*status, error) {
var (
numBlocks = uint64(64)
header = api.chain.CurrentHeader()
Expand Down Expand Up @@ -169,7 +169,7 @@ func (api *API) Status() (*Status, error) {
}
signStatus[sealer]++
}
return &Status{
return &status{
InturnPercent: float64((100 * optimals)) / float64(numBlocks),
SigningStatus: signStatus,
NumBlocks: numBlocks,
Expand Down

0 comments on commit 308a5b3

Please sign in to comment.