Skip to content

Commit

Permalink
Remove redundant fetching of block header prior to SubscribeBlockHead…
Browse files Browse the repository at this point in the history
…ersFromStartHeight
  • Loading branch information
m-Peter committed Jan 23, 2025
1 parent e7406e4 commit 723299f
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions services/ingestion/block_tracking_subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,6 @@ func (r *RPCBlockTrackingSubscriber) Subscribe(ctx context.Context) <-chan model
func (r *RPCBlockTrackingSubscriber) subscribe(ctx context.Context, height uint64) <-chan models.BlockEvents {
eventsChan := make(chan models.BlockEvents)

_, err := r.client.GetBlockHeaderByHeight(ctx, height)
if err != nil {
err = fmt.Errorf("failed to subscribe for events, the block height %d doesn't exist: %w", height, err)
eventsChan <- models.NewBlockEventsError(err)
return eventsChan
}

blockHeadersChan, errChan, err := r.client.SubscribeBlockHeadersFromStartHeight(
ctx,
height,
Expand Down

0 comments on commit 723299f

Please sign in to comment.