mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-19 12:56:12 +00:00
Upgrade codebase to new SlotClock API
This commit is contained in:
@@ -151,7 +151,7 @@ where
|
||||
// Determine the slot for the first block (or skipped block).
|
||||
let state_slot = match block_strategy {
|
||||
BlockStrategy::OnCanonicalHead => {
|
||||
self.chain.present_slot().expect("should have a slot") - 1
|
||||
self.chain.slot().expect("should have a slot") - 1
|
||||
}
|
||||
BlockStrategy::ForkCanonicalChainAt { previous_slot, .. } => previous_slot,
|
||||
};
|
||||
@@ -161,16 +161,14 @@ where
|
||||
|
||||
// Determine the first slot where a block should be built.
|
||||
let mut slot = match block_strategy {
|
||||
BlockStrategy::OnCanonicalHead => {
|
||||
self.chain.present_slot().expect("should have a slot")
|
||||
}
|
||||
BlockStrategy::OnCanonicalHead => self.chain.slot().expect("should have a slot"),
|
||||
BlockStrategy::ForkCanonicalChainAt { first_slot, .. } => first_slot,
|
||||
};
|
||||
|
||||
let mut head_block_root = None;
|
||||
|
||||
for _ in 0..num_blocks {
|
||||
while self.chain.present_slot().expect("should have a slot") < slot {
|
||||
while self.chain.slot().expect("should have a slot") < slot {
|
||||
self.advance_slot();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user