Refactor slot clock to remove underflow

Previously I had used `Instant` to refer to the genesis time.
This commit is contained in:
Paul Hauner
2019-09-21 11:21:47 +10:00
parent 1b497e2e24
commit 8ceb2e3d95
5 changed files with 81 additions and 84 deletions

View File

@@ -159,14 +159,11 @@ impl<B: BeaconNodeDuties + 'static, S: Signer + 'static, E: EthSpec> Service<B,
};
// build the validator slot clock
let slot_clock = SystemTimeSlotClock::from_eth2_genesis(
let slot_clock = SystemTimeSlotClock::new(
genesis_slot,
genesis_time,
Duration::from_secs(genesis_time),
Duration::from_millis(eth2_config.spec.milliseconds_per_slot),
)
.map_err::<error_chain::Error, _>(|e| {
format!("Unable to start slot clock: {}.", e).into()
})?;
);
/* Generate the duties manager */