From 1433b61a92531756fb420382306647d1d0ea5d30 Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Mon, 9 Jul 2018 14:11:51 -0700 Subject: [PATCH] Missed a min in slashing --- x/stake/keeper/slash.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/x/stake/keeper/slash.go b/x/stake/keeper/slash.go index a2080eab93..44bc2aade6 100644 --- a/x/stake/keeper/slash.go +++ b/x/stake/keeper/slash.go @@ -202,10 +202,7 @@ func (k Keeper) slashRedelegation(ctx sdk.Context, validator types.Validator, re // Possible since the redelegation may already // have been slashed, and slash amounts are calculated // according to stake held at time of infraction - redelegationSlashAmount := slashAmount - if redelegationSlashAmount.GT(redelegation.Balance.Amount) { - redelegationSlashAmount = redelegation.Balance.Amount - } + redelegationSlashAmount := sdk.MinInt(slashAmount, redelegation.Balance.Amount) // Update redelegation if necessary if !redelegationSlashAmount.IsZero() {