File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed
lib/lambda_ethereum_consensus/beacon Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -29,16 +29,18 @@ defmodule LambdaEthereumConsensus.Beacon.SyncBlocks do
29
29
initial_slot = Misc . compute_start_slot_at_epoch ( checkpoint . epoch ) + 1
30
30
last_slot = BeaconChain . get_current_slot ( )
31
31
32
- chunks =
33
- Enum . chunk_every ( initial_slot .. last_slot , @ blocks_per_chunk )
34
- |> Enum . map ( fn chunk ->
35
- first_slot = List . first ( chunk )
36
- last_slot = List . last ( chunk )
37
- count = last_slot - first_slot + 1
38
- % { from: first_slot , count: count }
39
- end )
40
-
41
- perform_sync ( chunks )
32
+ if last_slot > 0 do
33
+ chunks =
34
+ Enum . chunk_every ( initial_slot .. last_slot , @ blocks_per_chunk )
35
+ |> Enum . map ( fn chunk ->
36
+ first_slot = List . first ( chunk )
37
+ last_slot = List . last ( chunk )
38
+ count = last_slot - first_slot + 1
39
+ % { from: first_slot , count: count }
40
+ end )
41
+
42
+ perform_sync ( chunks )
43
+ end
42
44
end
43
45
44
46
@ spec perform_sync ( [ chunk ( ) ] ) :: :ok
You can’t perform that action at this time.
0 commit comments