Add Seconds Since Last Block to status
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
DataHoarder 2023-05-10 20:29:00 +02:00
parent 4f7b1bc121
commit b2daa7c54b
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk
2 changed files with 16 additions and 14 deletions

View file

@ -299,6 +299,7 @@ func main() {
Difficulty: types.DifficultyFrom64(tip.Difficulty),
CumulativeDifficulty: tip.CumulativeDifficulty,
Timestamp: tip.Timestamp,
SecondsSinceLastBlock: utils.Max(0, time.Now().Unix() - int64(tip.Timestamp)),
Effort: poolInfoResultSideChainEffort{
Current: currentEffort,
Average10: averageEffort(10),

View file

@ -28,20 +28,21 @@ type poolInfoResult struct {
}
type poolInfoResultSideChain struct {
Consensus *sidechain.Consensus `json:"consensus"`
Id types.Hash `json:"id"`
Height uint64 `json:"height"`
Difficulty types.Difficulty `json:"difficulty"`
CumulativeDifficulty types.Difficulty `json:"cumulative_difficulty"`
Timestamp uint64 `json:"timestamp"`
Effort poolInfoResultSideChainEffort `json:"effort"`
Window poolInfoResultSideChainWindow `json:"window"`
WindowSize int `json:"window_size"`
MaxWindowSize int `json:"max_window_size"`
BlockTime int `json:"block_time"`
UnclePenalty int `json:"uncle_penalty"`
Found uint64 `json:"found"`
Miners uint64 `json:"miners"`
Consensus *sidechain.Consensus `json:"consensus"`
Id types.Hash `json:"id"`
Height uint64 `json:"height"`
Difficulty types.Difficulty `json:"difficulty"`
CumulativeDifficulty types.Difficulty `json:"cumulative_difficulty"`
SecondsSinceLastBlock int64 `json:"seconds_since_last_block"`
Timestamp uint64 `json:"timestamp"`
Effort poolInfoResultSideChainEffort `json:"effort"`
Window poolInfoResultSideChainWindow `json:"window"`
WindowSize int `json:"window_size"`
MaxWindowSize int `json:"max_window_size"`
BlockTime int `json:"block_time"`
UnclePenalty int `json:"uncle_penalty"`
Found uint64 `json:"found"`
Miners uint64 `json:"miners"`
}
type poolInfoResultSideChainEffort struct {