consensus cleanup, privValidator config

This commit is contained in:
Jae Kwon
2014-10-24 14:37:12 -07:00
parent b615e51f95
commit 647d26f7a0
11 changed files with 197 additions and 121 deletions

View File

@@ -81,6 +81,11 @@ func (vset *ValidatorSet) GetById(id uint64) (index uint32, val *Validator) {
return
}
func (vset *ValidatorSet) HasId(id uint64) bool {
_, val_ := vset.validators.Get(id)
return val_ != nil
}
func (vset *ValidatorSet) GetByIndex(index uint32) (id uint64, val *Validator) {
id_, val_ := vset.validators.GetByIndex(uint64(index))
id, val = id_.(uint64), val_.(*Validator)