mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-11-26 23:45:50 +00:00
put validator rewards into else case to protect the claim object against bogus values
Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
parent
29b20e4392
commit
e21a4223f1
@ -125,11 +125,13 @@ func (k msgServer) getClaims(ctx sdk.Context, start int64, end int64) (claims Cl
|
||||
if err != nil {
|
||||
util.GetAppLogger().Error(ctx, "error converting initiator address")
|
||||
}
|
||||
validatorPopReward, found := k.getChallengeInitiatorReward(ctx, challenge.GetHeight())
|
||||
if !found {
|
||||
util.GetAppLogger().Error(ctx, "No PoP initiator reward found for height %v", challenge.GetHeight())
|
||||
else {
|
||||
validatorPopReward, found := k.getChallengeInitiatorReward(ctx, challenge.GetHeight())
|
||||
if !found {
|
||||
util.GetAppLogger().Error(ctx, "No PoP initiator reward found for height %v", challenge.GetHeight())
|
||||
}
|
||||
claims.initiator[initiatorAddr.String()] += validatorPopReward
|
||||
}
|
||||
claims.initiator[initiatorAddr.String()] += validatorPopReward
|
||||
|
||||
// if challenge not finished only initiator has claims
|
||||
if !challenge.GetFinished() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user