|
@ -59,13 +59,14 @@ func (valSet *ValidatorSet) IncrementAccum(times int) { |
|
|
// Decrement the validator with most accum times times
|
|
|
// Decrement the validator with most accum times times
|
|
|
for i := 0; i < times; i++ { |
|
|
for i := 0; i < times; i++ { |
|
|
mostest := validatorsHeap.Peek().(*Validator) |
|
|
mostest := validatorsHeap.Peek().(*Validator) |
|
|
|
|
|
// mind underflow
|
|
|
|
|
|
mostest.Accum = safeSubClip(mostest.Accum, valSet.TotalVotingPower()) |
|
|
|
|
|
|
|
|
if i == times-1 { |
|
|
if i == times-1 { |
|
|
valSet.Proposer = mostest |
|
|
valSet.Proposer = mostest |
|
|
|
|
|
} else { |
|
|
|
|
|
validatorsHeap.Update(mostest, accumComparable{mostest}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// mind underflow
|
|
|
|
|
|
mostest.Accum = safeSubClip(mostest.Accum, valSet.TotalVotingPower()) |
|
|
|
|
|
validatorsHeap.Update(mostest, accumComparable{mostest}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|