kivy: history screen: fix "future" txs
```
3.96 | E | gui.kivy.uix.dialogs.crash_reporter.ExceptionHook | exception caught by crash reporter
Traceback (most recent call last):
File "kivy/_clock.pyx", line 649, in kivy._clock.CyClockBase._process_events
File "kivy/_clock.pyx", line 218, in kivy._clock.ClockEvent.tick
File "/home/user/wspace/electrum/electrum/gui/kivy/main_window.py", line 1045, in update_wallet
self.update_tabs()
File "/home/user/wspace/electrum/electrum/util.py", line 462, in <lambda>
return lambda *args, **kw_args: do_profile(args, kw_args)
File "/home/user/wspace/electrum/electrum/util.py", line 458, in do_profile
o = func(*args, **kw_args)
File "/home/user/wspace/electrum/electrum/gui/kivy/main_window.py", line 506, in update_tabs
self.update_tab(name)
File "/home/user/wspace/electrum/electrum/gui/kivy/main_window.py", line 501, in update_tab
s.update()
File "/home/user/wspace/electrum/electrum/gui/kivy/uix/screens.py", line 161, in update
history_card.data = [self.get_card(item) for item in history]
File "/home/user/wspace/electrum/electrum/gui/kivy/uix/screens.py", line 161, in <listcomp>
history_card.data = [self.get_card(item) for item in history]
File "/home/user/wspace/electrum/electrum/gui/kivy/uix/screens.py", line 132, in get_card
status, status_str = self.app.wallet.get_tx_status(tx_hash, tx_mined_info)
File "/home/user/wspace/electrum/electrum/wallet.py", line 1491, in get_tx_status
num_blocks_remainining = tx_mined_info.wanted_height - self.adb.get_local_height()
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'
```
This commit is contained in:
@@ -126,9 +126,12 @@ class HistoryScreen(CScreen):
|
||||
fee_text = '' if fee is None else 'fee: %d sat'%fee
|
||||
else:
|
||||
tx_hash = tx_item['txid']
|
||||
tx_mined_info = TxMinedInfo(height=tx_item['height'],
|
||||
conf=tx_item['confirmations'],
|
||||
timestamp=tx_item['timestamp'])
|
||||
tx_mined_info = TxMinedInfo(
|
||||
height=tx_item['height'],
|
||||
conf=tx_item['confirmations'],
|
||||
timestamp=tx_item['timestamp'],
|
||||
wanted_height=tx_item.get('wanted_height', None),
|
||||
)
|
||||
status, status_str = self.app.wallet.get_tx_status(tx_hash, tx_mined_info)
|
||||
icon = f'atlas://{KIVY_GUI_PATH}/theming/atlas/light/' + TX_ICONS[status]
|
||||
message = tx_item['label'] or tx_hash
|
||||
|
||||
Reference in New Issue
Block a user