Skip to content

Commit

Permalink
Merge pull request #405 from klim0v/v1.2
Browse files Browse the repository at this point in the history
fix check EditCandidatePublicKeyData
  • Loading branch information
danil-lashin authored Sep 23, 2020
2 parents 2d1d97b + 5860869 commit f36673c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/transaction/edit_candidate_public_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@ func (data EditCandidatePublicKeyData) Run(tx *Transaction, context state.Interf
}
}

if checkState.Candidates().Exists(data.NewPubKey) {
return Response{
Code: code.CandidateExists,
Log: fmt.Sprintf("Candidate with such public key (%s) already exists", data.NewPubKey.String()),
Info: EncodeError(code.NewCandidateExists(data.NewPubKey.String())),
}
}

commissionInBaseCoin := tx.CommissionInBaseCoin()
commission := big.NewInt(0).Set(commissionInBaseCoin)

Expand Down

0 comments on commit f36673c

Please sign in to comment.