diff --git a/gui/android.py b/gui/android.py index fc899b536..0247dafd9 100644 --- a/gui/android.py +++ b/gui/android.py @@ -323,10 +323,10 @@ settings_layout = make_layout(""" ','') - values.append((conf_str, ' ' + time_str, ' ' + format_satoshis(value,True), ' ' + label)) + values.append((conf_str, ' ' + time_str, ' ' + format_satoshis(value, True), ' ' + label)) return values diff --git a/gui/gtk.py b/gui/gtk.py index 237ac59d5..5c81cba68 100644 --- a/gui/gtk.py +++ b/gui/gtk.py @@ -1171,7 +1171,7 @@ class ElectrumWindow: self.history_list.clear() for item in self.wallet.get_history(): - tx_hash, conf, is_mine, value, fee, balance, timestamp = item + tx_hash, conf, value, timestamp, balance = item if conf > 0: try: time_str = datetime.datetime.fromtimestamp( timestamp).isoformat(' ')[:-3] @@ -1199,6 +1199,7 @@ class ElectrumWindow: import datetime if not tx_hash: return '' tx = self.wallet.transactions.get(tx_hash) + tx.deserialize() is_relevant, is_mine, v, fee = self.wallet.get_wallet_delta(tx) conf, timestamp = self.wallet.verifier.get_confirmations(tx_hash) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 950377664..9429f3b2c 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -702,15 +702,8 @@ class ElectrumWindow(QMainWindow): else: icon = QIcon(":icons/confirmed.png") - if value is not None: - v_str = self.format_amount(value, True, whitespaces=True) - else: - v_str = _('unknown') - - if balance is not None: - balance_str = self.format_amount(balance, whitespaces=True) - else: - balance_str = _('unknown') + v_str = self.format_amount(value, True, whitespaces=True) + balance_str = self.format_amount(balance, whitespaces=True) label, is_default_label = self.wallet.get_label(tx_hash) if is_default_label: diff --git a/gui/text.py b/gui/text.py index 2866caac1..7d7bb17d1 100644 --- a/gui/text.py +++ b/gui/text.py @@ -108,10 +108,10 @@ class ElectrumGui: self.history = [] for item in self.wallet.get_history(): - tx_hash, conf, is_mine, value, fee, balance, timestamp = item + tx_hash, conf, value, timestamp, balance = item if conf: try: - time_str = datetime.datetime.fromtimestamp( timestamp).isoformat(' ')[:-3] + time_str = datetime.datetime.fromtimestamp(timestamp).isoformat(' ')[:-3] except Exception: time_str = "------" else: diff --git a/lib/util.py b/lib/util.py index 67750a4fe..df6b7a2c3 100644 --- a/lib/util.py +++ b/lib/util.py @@ -109,6 +109,8 @@ def user_dir(): def format_satoshis(x, is_diff=False, num_zeros = 0, decimal_point = 8, whitespaces=False): from decimal import Decimal + if x is None: + return 'unknown' s = Decimal(x) sign, digits, exp = s.as_tuple() digits = map(str, digits)