From 752102842cc3c957e7fc1fd5cd4c0ec646cb79b0 Mon Sep 17 00:00:00 2001 From: z-bowen Date: Mon, 17 Sep 2018 11:40:42 +0200 Subject: [PATCH] Problem: Code for `approved_elections` can be slightly simplified Solution: minor refactoring --- bigchaindb/elections/election.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bigchaindb/elections/election.py b/bigchaindb/elections/election.py index dd30640e..ca0a4be3 100644 --- a/bigchaindb/elections/election.py +++ b/bigchaindb/elections/election.py @@ -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():