Browse Source

reorder statements

pull/1898/head
Anton Kaliaev 7 years ago
parent
commit
59f624043c
No known key found for this signature in database GPG Key ID: 7B6881D965918214
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      state/execution.go

+ 7
- 7
state/execution.go View File

@ -284,18 +284,18 @@ func updateValidators(currentSet *types.ValidatorSet, abciUpdates []abci.Validat
address := valUpdate.Address
_, val := currentSet.GetByAddress(address)
if val == nil && valUpdate.VotingPower != 0 {
// add val
added := currentSet.Add(valUpdate)
if !added {
return fmt.Errorf("Failed to add new validator %v", valUpdate)
}
} else if valUpdate.VotingPower == 0 {
if valUpdate.VotingPower == 0 {
// remove val
_, removed := currentSet.Remove(address)
if !removed {
return fmt.Errorf("Failed to remove validator %X", address)
}
} else if val == nil {
// add val
added := currentSet.Add(valUpdate)
if !added {
return fmt.Errorf("Failed to add new validator %v", valUpdate)
}
} else {
// update val
updated := currentSet.Update(valUpdate)


Loading…
Cancel
Save