Simplify fork choice spec

This change should be non-substantive as any blocks in `blocks` should be descendants (inclusive) of the `store.justified_checkpoint` (refer `get_filtered_block_tree`) so that in `get_head` all blocks considered as potential heads will have `slot > justified_slot`. Considering this condition universally applies, adding the `and ...` arm to the conditional is unnecessary overhead.
This commit is contained in:
Alex Stokes 2020-10-07 16:52:51 -07:00 committed by GitHub
parent 5f9e6599e9
commit d0cf4e7bad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -230,7 +230,7 @@ def get_head(store: Store) -> Root:
while True: while True:
children = [ children = [
root for root in blocks.keys() root for root in blocks.keys()
if blocks[root].parent_root == head and blocks[root].slot > justified_slot if blocks[root].parent_root == head
] ]
if len(children) == 0: if len(children) == 0:
return head return head