fpost: Don't panic with nil new tipset
This commit is contained in:
parent
f7ab2103ce
commit
be2d138aac
@ -70,6 +70,9 @@ func (s *fpostScheduler) run(ctx context.Context) {
|
|||||||
var lowest, highest *types.TipSet = s.cur, nil
|
var lowest, highest *types.TipSet = s.cur, nil
|
||||||
|
|
||||||
for _, change := range changes {
|
for _, change := range changes {
|
||||||
|
if change.Val == nil {
|
||||||
|
log.Errorf("change.Val was nil")
|
||||||
|
}
|
||||||
switch change.Type {
|
switch change.Type {
|
||||||
case store.HCRevert:
|
case store.HCRevert:
|
||||||
lowest = change.Val
|
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 {
|
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)
|
newEPS, start, err := s.shouldFallbackPost(ctx, new)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user