Skip to content

Commit

Permalink
[staking] only validate duplicate candidate id after HF (#4318)
Browse files Browse the repository at this point in the history
  • Loading branch information
envestcc authored Jul 1, 2024
1 parent 7378cdf commit 80717a7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions action/protocol/staking/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -699,12 +699,11 @@ func (p *Protocol) handleCandidateRegister(ctx context.Context, act *action.Cand
}
}
candID = id
}
c = csm.GetByIdentifier(candID)
if c != nil {
return log, nil, &handleError{
err: ErrInvalidOwner,
failureStatus: iotextypes.ReceiptStatus_ErrCandidateAlreadyExist,
if csm.GetByIdentifier(candID) != nil {
return log, nil, &handleError{
err: ErrInvalidOwner,
failureStatus: iotextypes.ReceiptStatus_ErrCandidateAlreadyExist,
}
}
}
// cannot collide with existing name
Expand Down

0 comments on commit 80717a7

Please sign in to comment.