Skip to content

Commit 56c0933

Browse files
committed
depreciate ping due to not being reliable
1 parent 776f005 commit 56c0933

File tree

2 files changed

+10
-44
lines changed

2 files changed

+10
-44
lines changed

src/mainWindow.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class MainWindow(QWidget):
4141
# signal: UTXO list loading percent (emitted by load_utxos_thread in tabRewards)
4242
sig_UTXOsLoading = pyqtSignal(int)
4343

44-
4544
def __init__(self, parent, imgDir):
4645
super(QWidget, self).__init__(parent)
4746
self.parent = parent
@@ -145,13 +144,8 @@ def clearHWstatus(self, message=''):
145144
def clearRPCstatus(self):
146145
with self.lock:
147146
self.rpcConnected = False
148-
self.header.lastPingBox.setHidden(False)
149147
self.header.rpcLed.setPixmap(self.ledGrayH_icon)
150148
self.header.lastBlockLabel.setText("<em>Connecting...</em>")
151-
self.header.lastPingIcon.setPixmap(self.connRed_icon)
152-
self.header.responseTimeLabel.setText("--")
153-
self.header.responseTimeLabel.setStyleSheet("color: red")
154-
self.header.lastPingIcon.setStyleSheet("color: red")
155149

156150
def connButtons(self):
157151
self.header.button_checkRpc.clicked.connect(lambda: self.onCheckRpc())
@@ -355,25 +349,6 @@ def updateLastBlockLabel(self):
355349

356350
self.header.lastBlockLabel.setText(text)
357351

358-
def updateLastBlockPing(self):
359-
if not self.rpcConnected:
360-
self.header.lastPingBox.setHidden(True)
361-
else:
362-
self.header.lastPingBox.setHidden(False)
363-
if self.rpcResponseTime > 2:
364-
color = "red"
365-
self.header.lastPingIcon.setPixmap(self.connRed_icon)
366-
elif self.rpcResponseTime > 1:
367-
color = "orange"
368-
self.header.lastPingIcon.setPixmap(self.connOrange_icon)
369-
else:
370-
color = "green"
371-
self.header.lastPingIcon.setPixmap(self.connGreen_icon)
372-
if self.rpcResponseTime is not None:
373-
self.header.responseTimeLabel.setText("%.3f" % self.rpcResponseTime)
374-
self.header.responseTimeLabel.setStyleSheet("color: %s" % color)
375-
self.header.lastPingIcon.setStyleSheet("color: %s" % color)
376-
377352
def updateRPCled(self, fDebug=False):
378353
if self.rpcConnected:
379354
self.header.rpcLed.setPixmap(self.ledPurpleH_icon)
@@ -391,7 +366,6 @@ def updateRPCled(self, fDebug=False):
391366

392367
self.header.rpcLed.setToolTip(self.rpcStatusMess)
393368
self.updateLastBlockLabel()
394-
self.updateLastBlockPing()
395369

396370
def updateRPClist(self):
397371
# Clear old stuff

src/qt/guiHeader.py

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,21 @@ def __init__(self, caller, *args, **kwargs):
3131
self.rpcLed.setToolTip("%s" % caller.rpcStatusMess)
3232
self.rpcLed.setPixmap(caller.ledGrayH_icon)
3333
self.centralBox.addWidget(self.rpcLed, 0, 3)
34-
self.lastPingBox = QWidget()
34+
self.lastBlockBox = QWidget()
3535
sp_retain = QSizePolicy()
3636
sp_retain.setRetainSizeWhenHidden(True)
37-
self.lastPingBox.setSizePolicy(sp_retain)
38-
self.lastPingBox.setContentsMargins(0, 0, 0, 0)
39-
lastPingBoxLayout = QHBoxLayout()
40-
self.lastPingIcon = QLabel()
41-
self.lastPingIcon.setToolTip("Last ping server response time.\n(The lower, the better)")
42-
self.lastPingIcon.setPixmap(caller.connRed_icon)
43-
lastPingBoxLayout.addWidget(self.lastPingIcon)
44-
self.responseTimeLabel = QLabel()
45-
self.responseTimeLabel.setToolTip("Last ping server response time.\n(The lower, the better)")
46-
lastPingBoxLayout.addWidget(self.responseTimeLabel)
47-
lastPingBoxLayout.addSpacing(10)
37+
self.lastBlockBox.setSizePolicy(sp_retain)
38+
self.lastBlockBox.setContentsMargins(0, 0, 0, 0)
39+
lastBlockBoxLayout = QHBoxLayout()
4840
self.lastBlockIcon = QLabel()
49-
self.lastBlockIcon.setToolTip("Last ping block number")
41+
self.lastBlockIcon.setToolTip("Last known block number")
5042
self.lastBlockIcon.setPixmap(caller.lastBlock_icon)
51-
lastPingBoxLayout.addWidget(self.lastBlockIcon)
43+
lastBlockBoxLayout.addWidget(self.lastBlockIcon)
5244
self.lastBlockLabel = QLabel()
53-
self.lastBlockLabel.setToolTip("Last ping block number")
54-
lastPingBoxLayout.addWidget(self.lastBlockLabel)
55-
self.lastPingBox.setLayout(lastPingBoxLayout)
56-
self.centralBox.addWidget(self.lastPingBox, 0, 4)
45+
self.lastBlockLabel.setToolTip("Last known block number / status")
46+
lastBlockBoxLayout.addWidget(self.lastBlockLabel)
47+
self.lastBlockBox.setLayout(lastBlockBoxLayout)
48+
self.centralBox.addWidget(self.lastBlockBox, 0, 4)
5749
# -- 1b) Select & Check hardware
5850
label3 = QLabel("Hardware Device")
5951
self.centralBox.addWidget(label3, 1, 0)

0 commit comments

Comments
 (0)