mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
ForkCondition: some small refactors (#10712)
This commit is contained in:
@ -522,10 +522,11 @@ impl ChainSpec {
|
||||
ForkCondition::Timestamp(timestamp) => {
|
||||
// to satisfy every timestamp ForkCondition, we find the last ForkCondition::Block
|
||||
// if one exists, and include its block_num in the returned Head
|
||||
if let Some(last_block_num) = self.last_block_fork_before_merge_or_timestamp() {
|
||||
return Head { timestamp, number: last_block_num, ..Default::default() }
|
||||
Head {
|
||||
timestamp,
|
||||
number: self.last_block_fork_before_merge_or_timestamp().unwrap_or_default(),
|
||||
..Default::default()
|
||||
}
|
||||
Head { timestamp, ..Default::default() }
|
||||
}
|
||||
ForkCondition::TTD { total_difficulty, .. } => {
|
||||
Head { total_difficulty, ..Default::default() }
|
||||
|
||||
Reference in New Issue
Block a user