mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-06 16:17:11 +00:00
consensus: some more informative logging
This commit is contained in:
+1
-1
@@ -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()
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user