Skip to content

Commit

Permalink
Check nil message and report
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Guo <guojiannan1101@gmail.com>
  • Loading branch information
guoger committed Nov 6, 2020
1 parent d331da6 commit 34a2b47
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/infra/observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ func (o *Observer) Start(N int, now time.Time) {
o.signal <- err
}

if r == nil {
panic("Received nil message, but expect a valid block instead. You could look into your peer logs for more info")
}

fb := r.Type.(*peer.DeliverResponse_FilteredBlock)
n = n + len(fb.FilteredBlock.FilteredTransactions)
fmt.Printf("Time %8.2fs\tBlock %6d\tTx %6d\n", time.Since(now).Seconds(), fb.FilteredBlock.Number, len(fb.FilteredBlock.FilteredTransactions))
Expand Down

0 comments on commit 34a2b47

Please sign in to comment.