consensus: some more informative logging

This commit is contained in:
Ethan Buchman
2017-03-05 02:04:09 -05:00
parent d93d754972
commit de0153a1c4
4 changed files with 7 additions and 5 deletions

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()