Skip to content

Commit

Permalink
Merge pull request #1306 from ethereum/old_latest_message
Browse files Browse the repository at this point in the history
Found by Cem Özer: Ignore older latest messages in attesting balance
  • Loading branch information
djrtwo authored Jul 25, 2019
2 parents 5efdbb4 + 01af304 commit f9f722c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions specs/core/0_fork-choice.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ def get_genesis_store(genesis_state: BeaconState) -> Store:
```python
def get_ancestor(store: Store, root: Hash, slot: Slot) -> Hash:
block = store.blocks[root]
assert block.slot >= slot
return root if block.slot == slot else get_ancestor(store, block.parent_root, slot)
if block.slot > slot:
return get_ancestor(store, block.parent_root, slot)
elif block.slot == slot:
return root
else:
return Bytes32() # root is older than queried slot: no results.
```

#### `get_latest_attesting_balance`
Expand Down

0 comments on commit f9f722c

Please sign in to comment.