Merge pull request #1382 from EugeneChung/develop
remove Heap.Update() call when setting Proposer field
This commit is contained in:
commit
bf6527fc59
|
@ -59,14 +59,15 @@ func (valSet *ValidatorSet) IncrementAccum(times int) {
|
|||
// Decrement the validator with most accum times times
|
||||
for i := 0; i < times; i++ {
|
||||
mostest := validatorsHeap.Peek().(*Validator)
|
||||
if i == times-1 {
|
||||
valSet.Proposer = mostest
|
||||
}
|
||||
|
||||
// mind underflow
|
||||
mostest.Accum = safeSubClip(mostest.Accum, valSet.TotalVotingPower())
|
||||
|
||||
if i == times-1 {
|
||||
valSet.Proposer = mostest
|
||||
} else {
|
||||
validatorsHeap.Update(mostest, accumComparable{mostest})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Copy each validator into a new ValidatorSet
|
||||
|
|
Loading…
Reference in New Issue