Skip to content

Commit

Permalink
fix(indexer): fix potential panic in chain reconciliation logic durin…
Browse files Browse the repository at this point in the history
…g backfill (#12813)

Co-authored-by: Peter Rabbitson <ribasushi@leporine.io>
  • Loading branch information
parthshah1 and ribasushi authored Jan 8, 2025
1 parent 5e566ba commit 31c3a60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chain/index/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,10 @@ func (si *SqliteIndexer) backfillIndex(ctx context.Context, tx *sql.Tx, head *ty
log.Infof("reached stop height %d; backfilled %d tipsets", stopAfter, totalApplied)
return nil
}

height := currTs.Height()
currTs, err = si.cs.GetTipSetFromKey(ctx, currTs.Parents())
if err != nil {
return xerrors.Errorf("failed to walk chain at height %d: %w", currTs.Height(), err)
return xerrors.Errorf("failed to walk chain beyond height %d: %w", height, err)
}
}

Expand Down

0 comments on commit 31c3a60

Please sign in to comment.