Fix the 2/3 threshold calculation

Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
This commit is contained in:
Hsiao-Wei Wang 2021-01-07 11:14:32 +08:00 committed by GitHub
parent d01a4ad823
commit ce87914326
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -185,7 +185,7 @@ def process_light_client_update(store: LightClientStore, update: LightClientUpda
store.valid_updates.append(update)
if (
sum(update.sync_committee_bits) * 3 > len(update.sync_committee_bits) * 2
sum(update.sync_committee_bits) * 3 >= len(update.sync_committee_bits) * 2
and update.header != update.finality_header
):
# Apply update if 2/3 quorum is reached and we have a finality proof