mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-16 12:36:25 +00:00
Merge pull request #573 from ethereum/hwwhww/verify_bitfield
Fix `verify_bitfield`
This commit is contained in:
commit
ec1a08278b
@ -1099,7 +1099,8 @@ def verify_bitfield(bitfield: bytes, committee_size: int) -> bool:
|
|||||||
if len(bitfield) != (committee_size + 7) // 8:
|
if len(bitfield) != (committee_size + 7) // 8:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
for i in range(committee_size + 1, committee_size - committee_size % 8 + 8):
|
# Check `bitfield` is padded with zero bits only
|
||||||
|
for i in range(committee_size, len(bitfield) * 8):
|
||||||
if get_bitfield_bit(bitfield, i) == 0b1:
|
if get_bitfield_bit(bitfield, i) == 0b1:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user