Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
Fix verify_bitfield
Browse files Browse the repository at this point in the history
  • Loading branch information
hwwhww committed Feb 5, 2019
1 parent feb92c6 commit ff9b7fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 4 additions & 3 deletions eth2/beacon/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,9 +633,10 @@ def verify_bitfield(bitfield: bytes, committee_size: int) -> bool:
if len(bitfield) != get_bitfield_length(committee_size):
return False

for i in range(committee_size + 1, committee_size - committee_size % 8 + 8):
if has_voted(bitfield, i):
return False
if committee_size % 8 != 0:
for i in range(committee_size, committee_size - committee_size % 8 + 8):
if has_voted(bitfield, i):
return False

return True

Expand Down
3 changes: 1 addition & 2 deletions eth2/beacon/types/validator_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
FAR_FUTURE_EPOCH,
)
from eth2.beacon.typing import (
EpochNumber,
BLSPubkey,
SlotNumber,
EpochNumber,
)


Expand Down

0 comments on commit ff9b7fc

Please sign in to comment.