state: err if 0 power validator is added to the validator set

Closes #1893
This commit is contained in:
Anton Kaliaev
2018-07-04 12:36:11 +04:00
parent bff68abe04
commit dda8b67f37
2 changed files with 76 additions and 3 deletions

View File

@ -5,10 +5,10 @@ import (
fail "github.com/ebuchman/fail-test"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/proxy"
"github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tendermint/libs/db"
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/proxy"
"github.com/tendermint/tendermint/types"
)
//-----------------------------------------------------------------------------
@ -280,7 +280,7 @@ func updateValidators(currentSet *types.ValidatorSet, abciUpdates []abci.Validat
for _, valUpdate := range updates {
address := valUpdate.Address
_, val := currentSet.GetByAddress(address)
if val == nil {
if val == nil && valUpdate.VotingPower != 0 {
// add val
added := currentSet.Add(valUpdate)
if !added {