Browse Source

show 'server lagging' icon if server lags and client does not use auto-connect

283
thomasv 11 years ago
parent
commit
50c9830f79
  1. 3
      gui/qt/main_window.py
  2. 1
      icons.qrc
  3. BIN
      icons/status_lagging.png
  4. 9
      lib/blockchain.py
  5. 2
      make_packages

3
gui/qt/main_window.py

@ -535,6 +535,9 @@ class ElectrumWindow(QMainWindow):
if not self.wallet.up_to_date:
text = _("Synchronizing...")
icon = QIcon(":icons/status_waiting.png")
elif self.network.is_lagging:
text = _("Server is lagging")
icon = QIcon(":icons/status_lagging.png")
else:
c, u = self.wallet.get_account_balance(self.current_account)
text = _( "Balance" ) + ": %s "%( self.format_amount(c) ) + self.base_unit()

1
icons.qrc

@ -15,6 +15,7 @@
<file>icons/status_connected.png</file>
<file>icons/status_disconnected.png</file>
<file>icons/status_waiting.png</file>
<file>icons/status_lagging.png</file>
<file>icons/switchgui.png</file>
<file>icons/unconfirmed.png</file>
<file>icons/network.png</file>

BIN
icons/status_lagging.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

9
lib/blockchain.py

@ -37,6 +37,7 @@ class Blockchain(threading.Thread):
self.set_local_height()
self.queue = Queue.Queue()
self.servers_height = {}
self.is_lagging = False
def stop(self):
@ -91,15 +92,17 @@ class Blockchain(threading.Thread):
print_error("error", i.server)
# todo: dismiss that server
self.network.trigger_callback('updated')
h = self.servers_height.get(self.network.interface.server)
if h is not None and h < height - 1:
print_error( "Server is lagging", height, h)
if self.config.get('auto_cycle'):
self.network.set_server(i.server)
else:
self.network.interface.stop()
self.network.is_lagging = True
else:
self.network.is_lagging = False
self.network.trigger_callback('updated')

2
make_packages

@ -10,7 +10,7 @@ if __name__ == '__main__':
sys.exit()
os.system("python mki18n.py")
os.system("pyrcc4 icons.qrc -o gui/icons_rc.py")
os.system("pyrcc4 icons.qrc -o gui/qt/icons_rc.py")
os.system("python setup.py sdist --format=zip,gztar")
_tgz="Electrum-%s.tar.gz"%version

Loading…
Cancel
Save