Browse Source

qml network: restrict cases where server is shown "lagging"

master
SomberNight 3 years ago
parent
commit
53d61c011a
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 4
      electrum/gui/qml/components/NetworkOverview.qml
  2. 2
      electrum/network.py

4
electrum/gui/qml/components/NetworkOverview.qml

@ -69,11 +69,11 @@ Pane {
Label { Label {
text: qsTr('Server Height:'); text: qsTr('Server Height:');
color: Material.accentColor color: Material.accentColor
visible: Network.serverHeight != Network.height visible: Network.serverHeight != 0 && Network.serverHeight < Network.height
} }
Label { Label {
text: Network.serverHeight + " (lagging)" text: Network.serverHeight + " (lagging)"
visible: Network.serverHeight != Network.height visible: Network.serverHeight != 0 && Network.serverHeight < Network.height
} }
Heading { Heading {
Layout.columnSpan: 2 Layout.columnSpan: 2

2
electrum/network.py

@ -1218,7 +1218,7 @@ class Network(Logger, NetworkRetryManager[ServerAddr]):
interface = self.interface interface = self.interface
return interface.tip if interface else 0 return interface.tip if interface else 0
def get_local_height(self): def get_local_height(self) -> int:
"""Length of header chain, POW-verified. """Length of header chain, POW-verified.
In case of a chain split, this is for the branch the main interface is on, In case of a chain split, this is for the branch the main interface is on,
but it is the tip of that branch (even if main interface is behind). but it is the tip of that branch (even if main interface is behind).

Loading…
Cancel
Save