Update slashing period key appropriately

This commit is contained in:
Christopher Goes 2018-10-05 14:24:02 +02:00
parent 1f12f204ce
commit 1909d8f269
1 changed files with 2 additions and 1 deletions

View File

@ -34,7 +34,8 @@ func GetValidatorSlashingPeriodPrefix(v sdk.ConsAddress) []byte {
// stored by *Tendermint* address (not operator address) followed by start height
func GetValidatorSlashingPeriodKey(v sdk.ConsAddress, startHeight int64) []byte {
b := make([]byte, 8)
binary.LittleEndian.PutUint64(b, uint64(startHeight))
// this needs to be height + 1 because the slashing period for genesis validators starts at height -1
binary.LittleEndian.PutUint64(b, uint64(startHeight+1))
return append(GetValidatorSlashingPeriodPrefix(v), b...)
}