improved barak with logging into ~/.barak/outputs

This commit is contained in:
Jae Kwon
2015-04-19 15:45:06 -07:00
parent e4f01a55cf
commit 59e69434e1
4 changed files with 28 additions and 22 deletions

View File

@ -45,10 +45,6 @@ func NewValidatorSet(vals []*Validator) *ValidatorSet {
// TODO: mind the overflow when times and votingPower shares too large.
func (valSet *ValidatorSet) IncrementAccum(times uint) {
log.Debug("IncrementAccum", "times", times)
log.Debug(Fmt("IncrementAccum prior to accum: %v\n", valSet))
// Add VotingPower * times to each validator and order into heap.
validatorsHeap := NewHeap()
for _, val := range valSet.Validators {
@ -56,8 +52,6 @@ func (valSet *ValidatorSet) IncrementAccum(times uint) {
validatorsHeap.Push(val, accumComparable(val.Accum))
}
log.Debug(Fmt("IncrementAccum after accum: %v\n", valSet))
// Decrement the validator with most accum, times times.
for i := uint(0); i < times; i++ {
mostest := validatorsHeap.Peek().(*Validator)
@ -67,9 +61,6 @@ func (valSet *ValidatorSet) IncrementAccum(times uint) {
mostest.Accum -= int64(valSet.TotalVotingPower())
validatorsHeap.Update(mostest, accumComparable(mostest.Accum))
}
log.Debug(Fmt("IncrementAccum after decrements: %v\n", valSet))
log.Debug(Fmt("IncrementAccum chose proposer: %v\n", valSet.proposer))
}
func (valSet *ValidatorSet) Copy() *ValidatorSet {