Allow validator client to start before genesis

This commit is contained in:
Paul Hauner
2019-09-06 10:03:45 +10:00
parent 940ddd0d13
commit 8b69a48fc5
5 changed files with 48 additions and 37 deletions

View File

@@ -178,7 +178,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
genesis_state.genesis_time,
Duration::from_millis(spec.milliseconds_per_slot),
)
.ok_or_else(|| Error::SlotClockDidNotStart)?;
.map_err(|_| Error::SlotClockDidNotStart)?;
info!(log, "Beacon chain initialized from genesis";
"validator_count" => genesis_state.validators.len(),
@@ -220,7 +220,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
state.genesis_time,
Duration::from_millis(spec.milliseconds_per_slot),
)
.ok_or_else(|| Error::SlotClockDidNotStart)?;
.map_err(|_| Error::SlotClockDidNotStart)?;
let last_finalized_root = p.canonical_head.beacon_state.finalized_checkpoint.root;
let last_finalized_block = &p.canonical_head.beacon_block;