Problem: Code for approved_elections can be slightly simplified

Solution: minor refactoring
This commit is contained in:
z-bowen 2018-09-17 11:40:42 +02:00
parent e599914f31
commit 752102842c

View File

@ -255,9 +255,9 @@ class Election(Transaction):
validator_set_updated = False
validator_set_change = []
for election_id, votes in elections.items():
election = bigchain.get_transaction(election_id)
election = Election.has_concluded(bigchain, election_id, votes, new_height)
if not election.has_concluded(bigchain, election_id, votes, new_height):
if not election:
continue
if election.makes_validator_set_change():