remove LastCommitHeight

This commit is contained in:
Ethan Buchman
2016-11-16 20:58:53 -05:00
parent a3d863f83b
commit d7f6c0775a
3 changed files with 19 additions and 35 deletions

View File

@ -12,14 +12,12 @@ import (
// Volatile state for each Validator
// TODO: make non-volatile identity
// - Remove LastCommitHeight, send bitarray of vals that signed in BeginBlock
// - Remove Accum - it can be computed, and now valset becomes identifying
type Validator struct {
Address []byte `json:"address"`
PubKey crypto.PubKey `json:"pub_key"`
LastCommitHeight int `json:"last_commit_height"`
VotingPower int64 `json:"voting_power"`
Accum int64 `json:"accum"`
Address []byte `json:"address"`
PubKey crypto.PubKey `json:"pub_key"`
VotingPower int64 `json:"voting_power"`
Accum int64 `json:"accum"`
}
// Creates a new copy of the validator so we can mutate accum.
@ -57,7 +55,6 @@ func (v *Validator) String() string {
return fmt.Sprintf("Validator{%X %v %v VP:%v A:%v}",
v.Address,
v.PubKey,
v.LastCommitHeight,
v.VotingPower,
v.Accum)
}
@ -97,11 +94,10 @@ func RandValidator(randPower bool, minPower int64) (*Validator, *PrivValidator)
votePower += int64(RandUint32())
}
val := &Validator{
Address: privVal.Address,
PubKey: privVal.PubKey,
LastCommitHeight: 0,
VotingPower: votePower,
Accum: 0,
Address: privVal.Address,
PubKey: privVal.PubKey,
VotingPower: votePower,
Accum: 0,
}
return val, privVal
}