mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
fixed vote counting
This commit is contained in:
parent
0b22d65241
commit
1f7e1893f9
@ -482,10 +482,9 @@ class Bigchain(object):
|
|||||||
"""
|
"""
|
||||||
n_voters = len(block['block']['voters'])
|
n_voters = len(block['block']['voters'])
|
||||||
|
|
||||||
vote_list = [vote['vote']['is_block_valid'] for vote in block['votes']]
|
vote_list = [vote['vote']['is_block_valid'] for vote in block['block']['votes']]
|
||||||
|
|
||||||
n_invalid_votes = vote_list.count(False)
|
n_invalid_votes = vote_list.count(False)
|
||||||
|
|
||||||
if n_invalid_votes >= int(n_voters/2):
|
if n_invalid_votes >= int(n_voters/2):
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user