From be2d138aac94b949edff1ff1ea373bbad588e95b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sat, 18 Jan 2020 16:00:22 +0100 Subject: [PATCH] fpost: Don't panic with nil new tipset --- storage/fpost_sched.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/storage/fpost_sched.go b/storage/fpost_sched.go index cafb212b6..b6a59a40e 100644 --- a/storage/fpost_sched.go +++ b/storage/fpost_sched.go @@ -70,6 +70,9 @@ func (s *fpostScheduler) run(ctx context.Context) { var lowest, highest *types.TipSet = s.cur, nil for _, change := range changes { + if change.Val == nil { + log.Errorf("change.Val was nil") + } switch change.Type { case store.HCRevert: lowest = change.Val @@ -111,6 +114,9 @@ func (s *fpostScheduler) revert(ctx context.Context, newLowest *types.TipSet) er } func (s *fpostScheduler) update(ctx context.Context, new *types.TipSet) error { + if new == nil { + return xerrors.Errorf("no new tipset in fpostScheduler.update") + } newEPS, start, err := s.shouldFallbackPost(ctx, new) if err != nil { return err