From 815f5c199dfbb05f7945c84d1d46856ab88ebf58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Eckel?= Date: Mon, 20 Feb 2023 15:27:17 +0100 Subject: [PATCH] fixed bug : roll back caused from_dict call on a None object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jürgen Eckel --- planetmint/lib.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/planetmint/lib.py b/planetmint/lib.py index 661aacb..1e4499c 100644 --- a/planetmint/lib.py +++ b/planetmint/lib.py @@ -917,9 +917,12 @@ class Planetmint(object): # elections concluded at this height self.delete_elections(new_height) - txns = [self.get_transaction(tx_id) for tx_id in txn_ids] - - txns = [Transaction.from_dict(tx.to_dict()) for tx in txns] + txids = [self.get_transaction(tx_id) for tx_id in txn_ids] + txns = [] + if len( txids ) > 0: + for tx in txids: + if tx: + txns.append(Transaction.from_dict(tx.to_dict()) ) elections = self._get_votes(txns) for election_id in elections: