add error check to json unmarshall

Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
This commit is contained in:
Lorenz Herzberger 2023-09-25 16:50:42 +02:00
parent e22d590bf8
commit e3708573dd
No known key found for this signature in database
GPG Key ID: FA5EE906EB55316A

View File

@ -57,7 +57,10 @@ func isValidatorBlockProposer(ctx sdk.Context, proposerAddress []byte) bool {
}
var keyFile KeyFile
json.Unmarshal(jsonBytes, &keyFile)
err = json.Unmarshal(jsonBytes, &keyFile)
if err != nil {
logger.Error("error while unmarshaling key file", err)
}
return hexProposerAddress == strings.ToLower(keyFile.Address)
}