Skip to content
This repository has been archived by the owner on Sep 8, 2023. It is now read-only.

Commit

Permalink
Validate submitted block before broadcasting (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
avalonche committed Apr 3, 2023
1 parent 48fb92e commit cecd2d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions beacon-chain/rpc/eth/beacon/blocks.go
Expand Up @@ -1099,13 +1099,13 @@ func (bs *Server) submitBlock(ctx context.Context, blockRoot [fieldparams.RootLe
if err != nil {
return errors.Wrap(err, "could not get protobuf block")
}
if err := bs.Broadcaster.Broadcast(ctx, blockPb); err != nil {
return status.Errorf(codes.Internal, "Could not broadcast block: %v", err)
}

if err := bs.BlockReceiver.ReceiveBlock(ctx, block, blockRoot); err != nil {
return status.Errorf(codes.Internal, "Could not process beacon block: %v", err)
}

if err := bs.Broadcaster.Broadcast(ctx, blockPb); err != nil {
return status.Errorf(codes.Internal, "Could not broadcast block: %v", err)
}

return nil
}

0 comments on commit cecd2d9

Please sign in to comment.