Skip to content

Commit 31edf30

Browse files
committed
[hotfix] fix an emergent bug on updating validator account
1 parent ca5421a commit 31edf30

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

modules/stake/handler.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,11 @@ func (c check) updateCandidateAccount(tx TxUpdateCandidacyAccount, gasFee sdk.In
452452
return 0, ErrBadRequest()
453453
}
454454

455+
tmp := GetCandidateByAddress(tx.NewCandidateAddress)
456+
if tmp != nil {
457+
return 0, ErrBadRequest()
458+
}
459+
455460
// check if the new address has been delegated the candidate
456461
d := GetDelegation(tx.NewCandidateAddress, candidate.Id)
457462
if d != nil {
@@ -484,6 +489,11 @@ func (c check) acceptCandidateAccountUpdateRequest(tx TxAcceptCandidacyAccountUp
484489
return ErrBadRequest()
485490
}
486491

492+
tmp := GetCandidateByAddress(req.ToAddress)
493+
if tmp != nil {
494+
return ErrBadRequest()
495+
}
496+
487497
// check if the new address has been delegated the candidate
488498
d := GetDelegation(req.ToAddress, req.CandidateId)
489499
if d != nil {

version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
const Major = "0"
88
const Minor = "1"
99
const Patch = "3"
10-
const Label = "beta-hotfix1"
10+
const Label = "beta-hotfix2"
1111

1212
var (
1313
// Version is the current version of Travis

0 commit comments

Comments
 (0)