Bare consensus refactor

This commit is contained in:
Jae Kwon
2015-11-01 11:34:08 -08:00
parent 5abf2e3c43
commit e12f9d10e7
101 changed files with 342 additions and 12709 deletions

View File

@ -1,29 +1,24 @@
package core
import (
"github.com/tendermint/go-wire"
cm "github.com/tendermint/tendermint/consensus"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
"github.com/tendermint/tendermint/types"
"github.com/tendermint/go-wire"
)
func ListValidators() (*ctypes.ResultListValidators, error) {
var blockHeight int
var bondedValidators []*types.Validator
var unbondingValidators []*types.Validator
var validators []*types.Validator
state := consensusState.GetState()
blockHeight = state.LastBlockHeight
state.BondedValidators.Iterate(func(index int, val *types.Validator) bool {
bondedValidators = append(bondedValidators, val)
return false
})
state.UnbondingValidators.Iterate(func(index int, val *types.Validator) bool {
unbondingValidators = append(unbondingValidators, val)
state.Validators.Iterate(func(index int, val *types.Validator) bool {
validators = append(validators, val)
return false
})
return &ctypes.ResultListValidators{blockHeight, bondedValidators, unbondingValidators}, nil
return &ctypes.ResultListValidators{blockHeight, validators}, nil
}
func DumpConsensusState() (*ctypes.ResultDumpConsensusState, error) {