WIP: Track validator height (closes #582)

This commit is contained in:
Christopher Goes 2018-04-06 13:11:26 +02:00
parent 36f5797660
commit 91e850b568
No known key found for this signature in database
GPG Key ID: E828D98232D328D3
1 changed files with 0 additions and 18 deletions

View File

@ -96,24 +96,6 @@ func (k Keeper) setCandidate(ctx sdk.Context, candidate Candidate) {
if oldFound {
store.Delete(GetValidatorKey(address, oldCandidate.Assets, oldCandidate.ValidatorHeight, k.cdc))
}
// update the validator block height
candidate.ValidatorHeight = ctx.BlockHeight()
// update the candidate record
bz, err = k.cdc.MarshalBinary(candidate)
if err != nil {
panic(err)
}
store.Set(GetCandidateKey(candidate.Address), bz)
// marshal the new validator record
validator := candidate.validator()
bz, err = k.cdc.MarshalBinary(validator)
if err != nil {
panic(err)
}
store.Set(GetValidatorKey(address, validator.Power, validator.Height, k.cdc), bz)
// add to the validators to update list if is already a validator