mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-21 06:48:12 +00:00
Apply suggestions from code review
This commit is contained in:
parent
6cfd38e800
commit
61207c5b61
@ -45,6 +45,7 @@ def get_pow_block_at_terminal_total_difficulty(pow_chain: Dict[Hash32, PowBlock]
|
||||
# `pow_chain` abstractly represents all blocks in the PoW chain
|
||||
for block in pow_chain:
|
||||
block_reached_ttd = block.total_difficulty >= TERMINAL_TOTAL_DIFFICULTY
|
||||
# If genesis block, no parent exists so reaching TTD alone qualifies as valid terminal block
|
||||
if block_reached_ttd and block.parent_hash == Hash32():
|
||||
return block
|
||||
parent = pow_chain[block.parent_hash]
|
||||
|
Loading…
x
Reference in New Issue
Block a user