Skip to content

Commit

Permalink
Update receive_block.go
Browse files Browse the repository at this point in the history
  • Loading branch information
terencechain committed Mar 10, 2022
1 parent 5d7704e commit 5b4a87c
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions beacon-chain/blockchain/receive_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (s *Service) ReceiveBlockBatch(ctx context.Context, blocks []block.SignedBe
defer span.End()

// Apply state transition on the incoming newly received blockCopy without verifying its BLS contents.
fCheckpoints, jCheckpoints, optimistic, err := s.onBlockBatch(ctx, blocks, blkRoots)
fCheckpoints, jCheckpoints, _, err := s.onBlockBatch(ctx, blocks, blkRoots)
if err != nil {
err := errors.Wrap(err, "could not process block in batch")
tracing.AnnotateError(span, err)
Expand All @@ -91,18 +91,6 @@ func (s *Service) ReceiveBlockBatch(ctx context.Context, blocks []block.SignedBe
tracing.AnnotateError(span, err)
return err
}
if !optimistic[i] {
root, err := b.Block().HashTreeRoot()
if err != nil {
return err
}
if err := s.cfg.ForkChoiceStore.UpdateSyncedTipsWithValidRoot(ctx, root); err != nil {
return err
}
if err := s.saveSyncedTipsDB(ctx); err != nil {
return errors.Wrap(err, "could not save synced tips")
}
}

// Send notification of the processed block to the state feed.
s.cfg.StateNotifier.StateFeed().Send(&feed.Event{
Expand Down

0 comments on commit 5b4a87c

Please sign in to comment.