Skip to content

Commit

Permalink
Fix/validator diagnostics (#1207)
Browse files Browse the repository at this point in the history
* Added stats for validator

* Beautify

* Fix lint

* Added mutex

* Added mutex for getters

* Added mutex for getters

* Remove redundant locking and unlocking
  • Loading branch information
Jayashsatolia403 authored Aug 12, 2023
1 parent 1637690 commit d14239b
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions code/go/0chain.net/validatorcore/storage/challenge_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,11 @@ func challengeHandler(ctx context.Context, r *http.Request) (interface{}, error)

err = challengeRequest.VerifyChallenge(challengeObj, allocationObj)
if err != nil {
statsMutex.Lock()
updateStats(false)
statsMutex.Unlock()
return InvalidValidationTicket(challengeObj, err)
}

statsMutex.Lock()
updateStats(false)
statsMutex.Unlock()

return ValidValidationTicket(challengeObj, challengeRequest.ChallengeID, challengeHash)
}
Expand Down

0 comments on commit d14239b

Please sign in to comment.