From c4d01c04a48001eb731fcf00831991fe8282aeb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 15 May 2020 19:06:52 +0200 Subject: [PATCH] chainwatch: don't crash with nil ticket --- cmd/lotus-chainwatch/storage.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/lotus-chainwatch/storage.go b/cmd/lotus-chainwatch/storage.go index 47f367e8d..020ca1d7f 100644 --- a/cmd/lotus-chainwatch/storage.go +++ b/cmd/lotus-chainwatch/storage.go @@ -653,6 +653,14 @@ create temp table b (like blocks excluding constraints) on commit drop; eprof = bh.ElectionProof.VRFProof } + if bh.Ticket == nil { + log.Warnf("got a block with nil ticket") + + bh.Ticket = &types.Ticket{ + VRFProof: []byte{}, + } + } + if _, err := stmt2.Exec( bh.Cid().String(), bh.ParentWeight.String(),