mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-06-07 22:56:37 +00:00
add error check to json unmarshall
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
This commit is contained in:
parent
e22d590bf8
commit
e3708573dd
@ -57,7 +57,10 @@ func isValidatorBlockProposer(ctx sdk.Context, proposerAddress []byte) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var keyFile KeyFile
|
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)
|
return hexProposerAddress == strings.ToLower(keyFile.Address)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user