show 'server lagging' icon if server lags and client does not use auto-connect
This commit is contained in:
parent
e462ef48cd
commit
50c9830f79
|
@ -535,6 +535,9 @@ class ElectrumWindow(QMainWindow):
|
||||||
if not self.wallet.up_to_date:
|
if not self.wallet.up_to_date:
|
||||||
text = _("Synchronizing...")
|
text = _("Synchronizing...")
|
||||||
icon = QIcon(":icons/status_waiting.png")
|
icon = QIcon(":icons/status_waiting.png")
|
||||||
|
elif self.network.is_lagging:
|
||||||
|
text = _("Server is lagging")
|
||||||
|
icon = QIcon(":icons/status_lagging.png")
|
||||||
else:
|
else:
|
||||||
c, u = self.wallet.get_account_balance(self.current_account)
|
c, u = self.wallet.get_account_balance(self.current_account)
|
||||||
text = _( "Balance" ) + ": %s "%( self.format_amount(c) ) + self.base_unit()
|
text = _( "Balance" ) + ": %s "%( self.format_amount(c) ) + self.base_unit()
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
<file>icons/status_connected.png</file>
|
<file>icons/status_connected.png</file>
|
||||||
<file>icons/status_disconnected.png</file>
|
<file>icons/status_disconnected.png</file>
|
||||||
<file>icons/status_waiting.png</file>
|
<file>icons/status_waiting.png</file>
|
||||||
|
<file>icons/status_lagging.png</file>
|
||||||
<file>icons/switchgui.png</file>
|
<file>icons/switchgui.png</file>
|
||||||
<file>icons/unconfirmed.png</file>
|
<file>icons/unconfirmed.png</file>
|
||||||
<file>icons/network.png</file>
|
<file>icons/network.png</file>
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
|
@ -37,6 +37,7 @@ class Blockchain(threading.Thread):
|
||||||
self.set_local_height()
|
self.set_local_height()
|
||||||
self.queue = Queue.Queue()
|
self.queue = Queue.Queue()
|
||||||
self.servers_height = {}
|
self.servers_height = {}
|
||||||
|
self.is_lagging = False
|
||||||
|
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
|
@ -91,15 +92,17 @@ class Blockchain(threading.Thread):
|
||||||
print_error("error", i.server)
|
print_error("error", i.server)
|
||||||
# todo: dismiss that server
|
# todo: dismiss that server
|
||||||
|
|
||||||
self.network.trigger_callback('updated')
|
|
||||||
|
|
||||||
h = self.servers_height.get(self.network.interface.server)
|
h = self.servers_height.get(self.network.interface.server)
|
||||||
if h is not None and h < height - 1:
|
if h is not None and h < height - 1:
|
||||||
print_error( "Server is lagging", height, h)
|
print_error( "Server is lagging", height, h)
|
||||||
if self.config.get('auto_cycle'):
|
if self.config.get('auto_cycle'):
|
||||||
self.network.set_server(i.server)
|
self.network.set_server(i.server)
|
||||||
else:
|
else:
|
||||||
self.network.interface.stop()
|
self.network.is_lagging = True
|
||||||
|
else:
|
||||||
|
self.network.is_lagging = False
|
||||||
|
|
||||||
|
self.network.trigger_callback('updated')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ if __name__ == '__main__':
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
os.system("python mki18n.py")
|
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")
|
os.system("python setup.py sdist --format=zip,gztar")
|
||||||
|
|
||||||
_tgz="Electrum-%s.tar.gz"%version
|
_tgz="Electrum-%s.tar.gz"%version
|
||||||
|
|
Loading…
Reference in New Issue