consensus: some more informative logging

This commit is contained in:
Ethan Buchman
2017-03-05 02:15:46 -05:00
parent d93d754972
commit de0153a1c4
4 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ func (b *Block) FillHeader() {
// If the block is incomplete, block hash is nil for safety.
func (b *Block) Hash() []byte {
// fmt.Println(">>", b.Data)
if b.Header == nil || b.Data == nil || b.LastCommit == nil {
if b == nil || b.Header == nil || b.Data == nil || b.LastCommit == nil {
return nil
}
b.FillHeader()
+2 -2
View File
@@ -6,7 +6,7 @@ import (
"sort"
"strings"
. "github.com/tendermint/go-common"
cmn "github.com/tendermint/go-common"
"github.com/tendermint/go-merkle"
)
@@ -48,7 +48,7 @@ func NewValidatorSet(vals []*Validator) *ValidatorSet {
// TODO: mind the overflow when times and votingPower shares too large.
func (valSet *ValidatorSet) IncrementAccum(times int) {
// Add VotingPower * times to each validator and order into heap.
validatorsHeap := NewHeap()
validatorsHeap := cmn.NewHeap()
for _, val := range valSet.Validators {
val.Accum += int64(val.VotingPower) * int64(times) // TODO: mind overflow
validatorsHeap.Push(val, accumComparable(val.Accum))