Skip to content

Commit

Permalink
Fix issue with pre-genesis start
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhauner committed Sep 21, 2020
1 parent 3da70ee commit 5bb065b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions beacon_node/beacon_chain/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,16 @@ where
.genesis_block_root
.ok_or_else(|| "Cannot build without a genesis block root".to_string())?;

let current_slot = slot_clock
.now()
.ok_or_else(|| "Unable to read slot".to_string())?;
let current_slot = if slot_clock
.is_prior_to_genesis()
.ok_or_else(|| "Unable to read slot clock".to_string())?
{
self.spec.genesis_slot
} else {
slot_clock
.now()
.ok_or_else(|| "Unable to read slot".to_string())?
};

let head_block_root = fork_choice
.get_head(current_slot)
Expand Down

0 comments on commit 5bb065b

Please sign in to comment.