Skip to content

Commit

Permalink
Merge pull request #667 from ThomasMeier/FD-869_fully_booted_diagnost…
Browse files Browse the repository at this point in the history
…ics_API

Add lastblockfromdbstate to diagnostics API
  • Loading branch information
carryforward committed Mar 13, 2019
2 parents d2e5799 + 56572d6 commit 466bcaa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions common/interfaces/state.go
Expand Up @@ -53,6 +53,7 @@ type IState interface {
GetFactomdVersion() string
GetDBHeightComplete() uint32
GetDBHeightAtBoot() uint32
GetDBFinished() bool
DatabaseContains(hash IHash) bool
SetOut(bool) // Output is turned on if set to true
GetOut() bool // Return true if Print or Println write output
Expand Down
4 changes: 4 additions & 0 deletions state/state.go
Expand Up @@ -2943,3 +2943,7 @@ func (s *State) IsActive(id activations.ActivationType) bool {

return rval
}

func (s *State) GetDBFinished() bool {
return s.DBFinished
}
7 changes: 4 additions & 3 deletions wsapi/wsapiStructs.go
Expand Up @@ -318,9 +318,10 @@ type DiagnosticsResponse struct {
TempBalanceHash string `json:"tempbalancehash"`
LastBlockFromDBState bool `json:"lastblockfromdbstate"`

SyncInfo *SyncInfo `json:"syncing"`
AuthSet *AuthSet `json:"authset"`
ElectionInfo *ElectionInfo `json:"elections"`
SyncInfo *SyncInfo `json:"syncing"`
BootFromDiskDone bool `json:"bootfromdiskdone"`
AuthSet *AuthSet `json:"authset"`
ElectionInfo *ElectionInfo `json:"elections"`
}

type SyncInfo struct {
Expand Down
1 change: 1 addition & 0 deletions wsapi/wsapiV2.go
Expand Up @@ -1402,6 +1402,7 @@ func HandleV2Diagnostics(state interfaces.IState, params interface{}) (interface
resp.BalanceHash = state.GetFactoidState().GetBalanceHash(false).String()
resp.TempBalanceHash = state.GetFactoidState().GetBalanceHash(true).String()
resp.LastBlockFromDBState = state.DidCreateLastBlockFromDBState()
resp.BootFromDiskDone = state.GetDBFinished()

feds := state.GetFedServers(resp.LeaderHeight)
fedCount := len(feds)
Expand Down

0 comments on commit 466bcaa

Please sign in to comment.