chainwatch: don't crash with nil ticket

This commit is contained in:
Łukasz Magiera 2020-05-15 19:06:52 +02:00
parent f86a2ced06
commit c4d01c04a4

View File

@ -653,6 +653,14 @@ create temp table b (like blocks excluding constraints) on commit drop;
eprof = bh.ElectionProof.VRFProof 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( if _, err := stmt2.Exec(
bh.Cid().String(), bh.Cid().String(),
bh.ParentWeight.String(), bh.ParentWeight.String(),