diff --git a/common/error.go b/common/error.go index 88c9e39..b4b73b1 100644 --- a/common/error.go +++ b/common/error.go @@ -3,3 +3,4 @@ package common import "fmt" var ErrEventExpired = fmt.Errorf("event expired") +var ErrDuplicatedSlashing = fmt.Errorf("duplicated slashing") diff --git a/verifier/hash_verifier.go b/verifier/hash_verifier.go index 38ac367..a86e5b8 100644 --- a/verifier/hash_verifier.go +++ b/verifier/hash_verifier.go @@ -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 } }