1
0

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

This commit is contained in:
SomberNight
2023-05-03 13:49:44 +00:00
parent 3bdda3a861
commit 53d61c011a
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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).