Browse Source

simplify prev

3.3.3.1
SomberNight 7 years ago
parent
commit
19d4bd4837
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 5
      electrum/gui/qt/main_window.py

5
electrum/gui/qt/main_window.py

@ -125,7 +125,6 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
self.tx_notification_queue = queue.Queue() self.tx_notification_queue = queue.Queue()
self.tx_notification_last_time = 0 self.tx_notification_last_time = 0
self.tx_notification_event = threading.Event()
self.create_status_bar() self.create_status_bar()
self.need_update = threading.Event() self.need_update = threading.Event()
@ -304,7 +303,6 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
# FIXME maybe this event should also include which wallet # FIXME maybe this event should also include which wallet
# the tx is for. now all wallets get this. # the tx is for. now all wallets get this.
self.tx_notification_queue.put(args[0]) self.tx_notification_queue.put(args[0])
self.tx_notification_event.set()
elif event in ['status', 'banner', 'verified', 'fee']: elif event in ['status', 'banner', 'verified', 'fee']:
# Handle in GUI thread # Handle in GUI thread
self.network_signal.emit(event, args) self.network_signal.emit(event, args)
@ -593,12 +591,11 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
# note: during initial history sync for a wallet, many txns will be # note: during initial history sync for a wallet, many txns will be
# received multiple times. hence the "total amount received" will be # received multiple times. hence the "total amount received" will be
# a lot higher than should be. this is expected though not intended # a lot higher than should be. this is expected though not intended
if not self.tx_notification_event.is_set(): if self.tx_notification_queue.qsize() == 0:
return return
now = time.time() now = time.time()
if self.tx_notification_last_time + 5 > now: if self.tx_notification_last_time + 5 > now:
return return
self.tx_notification_event.clear()
self.tx_notification_last_time = now self.tx_notification_last_time = now
self.print_error("Notifying GUI about new transactions") self.print_error("Notifying GUI about new transactions")
txns = [] txns = []

Loading…
Cancel
Save