Merge pull request #1755 from filecoin-project/fix/cw-tkt-crash

chainwatch: Don't crash with nil ticket
This commit is contained in:
Łukasz Magiera 2020-05-15 19:17:45 +02:00 committed by GitHub
commit 173a72f374
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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