Skip to content

Commit

Permalink
fix for goal node status crash - no longer getting block (#5100)
Browse files Browse the repository at this point in the history
  • Loading branch information
mciccarello authored and algolucky committed Feb 2, 2023
1 parent 17635c8 commit 3355ce6
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions daemon/algod/api/server/v2/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -772,12 +772,6 @@ func (v2 *Handlers) GetStatus(ctx echo.Context) error {
return internalError(ctx, err, errFailedRetrievingNodeStatus, v2.Log)
}

ledger := v2.Node.LedgerForAPI()
latestBlkHdr, err := ledger.BlockHdr(ledger.Latest())
if err != nil {
return internalError(ctx, err, errFailedRetrievingLatestBlockHeaderStatus, v2.Log)
}

response := model.NodeStatusResponse{
LastRound: uint64(stat.LastRound),
LastVersion: string(stat.LastVersion),
Expand Down Expand Up @@ -813,7 +807,7 @@ func (v2 *Handlers) GetStatus(ctx echo.Context) error {
votesNo := votes - votesYes
upgradeDelay := uint64(stat.UpgradeDelay)
response.UpgradeVotesRequired = &upgradeThreshold
response.UpgradeNodeVote = &latestBlkHdr.UpgradeApprove
response.UpgradeNodeVote = &stat.UpgradeApprove
response.UpgradeDelay = &upgradeDelay
response.UpgradeVotes = &votes
response.UpgradeYesVotes = &votesYes
Expand Down

0 comments on commit 3355ce6

Please sign in to comment.