Skip to content

Commit

Permalink
fix: precheck not handled properly when duplicated slashing is found (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
randyahx authored Nov 30, 2023
1 parent c2ad186 commit 0030740
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions common/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ package common
import "fmt"

var ErrEventExpired = fmt.Errorf("event expired")
var ErrDuplicatedSlashing = fmt.Errorf("duplicated slashing")
3 changes: 2 additions & 1 deletion verifier/hash_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ func (v *Verifier) preCheck(event *model.Event, currentHeight uint64) error {
return err
}
if found {
return v.dataProvider.UpdateEventStatus(event.ChallengeId, model.Duplicated)
_ = v.dataProvider.UpdateEventStatus(event.ChallengeId, model.Duplicated)
return common.ErrDuplicatedSlashing
}
}

Expand Down

0 comments on commit 0030740

Please sign in to comment.