mirror of
https://github.com/sigp/lighthouse.git
synced 2026-07-03 21:04:28 +00:00
Replace unreachable expect with tidier solution (#1278)
This commit is contained in:
@@ -1225,14 +1225,9 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while !filtered_chain_segment.is_empty() {
|
while let Some((_root, block)) = filtered_chain_segment.first() {
|
||||||
// Determine the epoch of the first block in the remaining segment.
|
// Determine the epoch of the first block in the remaining segment.
|
||||||
let start_epoch = filtered_chain_segment
|
let start_epoch = block.slot().epoch(T::EthSpec::slots_per_epoch());
|
||||||
.first()
|
|
||||||
.map(|(_root, block)| block)
|
|
||||||
.expect("chain_segment cannot be empty")
|
|
||||||
.slot()
|
|
||||||
.epoch(T::EthSpec::slots_per_epoch());
|
|
||||||
|
|
||||||
// The `last_index` indicates the position of the last block that is in the current
|
// The `last_index` indicates the position of the last block that is in the current
|
||||||
// epoch of `start_epoch`.
|
// epoch of `start_epoch`.
|
||||||
|
|||||||
Reference in New Issue
Block a user