Skip to content

Commit

Permalink
Merge pull request #73 from Fairblock/feature/no-pub-key-no-slash
Browse files Browse the repository at this point in the history
Add not slash validator when no active pub key
  • Loading branch information
p0p3yee authored Dec 22, 2023
2 parents 1797908 + e0f17f8 commit e732095
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions x/keyshare/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.Val
continue
}

if val, found := am.keeper.GetActivePubKey(ctx); !found || len(val.PublicKey) == 0 {
// Not slashing validator if there is no active public key
am.keeper.SetLastSubmittedHeight(ctx, eachValidator.Validator, strconv.FormatInt(ctx.BlockHeight(), 10))
continue
}

am.keeper.StakingKeeper().Slash(
ctx,
consAddr,
Expand Down

0 comments on commit e732095

Please sign in to comment.