mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Clarify the conclusion order in Election.process_blocks.
This commit is contained in:
parent
4a96216356
commit
0576f3ef73
@ -200,14 +200,13 @@ class Election(Transaction):
|
||||
|
||||
Custom elections may override this function and introduce additional checks.
|
||||
"""
|
||||
if self.has_validator_set_changed(bigchain):
|
||||
return False
|
||||
|
||||
election_pk = self.to_public_key(self.id)
|
||||
votes_committed = self.get_commited_votes(bigchain, election_pk)
|
||||
votes_current = self.count_votes(election_pk, current_votes)
|
||||
|
||||
if self.has_validator_set_changed(bigchain):
|
||||
return False
|
||||
|
||||
current_validators = self.get_validators(bigchain)
|
||||
total_votes = sum(current_validators.values())
|
||||
if (votes_committed < (2/3) * total_votes) and \
|
||||
@ -266,7 +265,8 @@ class Election(Transaction):
|
||||
marked as such.
|
||||
|
||||
Elections and votes are processed in the order in which they
|
||||
appear in the block.
|
||||
appear in the block. Elections are concluded in the order of
|
||||
appearance of their first votes in the block.
|
||||
|
||||
For every election concluded in the block, calls its `on_approval`
|
||||
method. The returned value of the last `on_approval`, if any,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user