Skip to content

Commit

Permalink
rpcapi: use height from state
Browse files Browse the repository at this point in the history
  • Loading branch information
p4u committed Nov 23, 2023
1 parent 06ffd3a commit 7f78220
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rpcapi/votehandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,10 @@ func (r *RPCAPI) getEntityList(request *api.APIrequest) (*api.APIresponse, error

func (r *RPCAPI) getBlockStatus(request *api.APIrequest) (*api.APIresponse, error) {
var response api.APIresponse
h := r.vocapp.Height()
h, err := r.vocapp.State.LastHeight()
if err != nil {
return nil, fmt.Errorf("cannot get block status: %w", err)
}
response.Height = &h
response.BlockTime = r.vocinfo.BlockTimes()
response.BlockTimestamp = int32(r.vocapp.Timestamp())
Expand Down

0 comments on commit 7f78220

Please sign in to comment.