Skip to content

Commit 9ecdd8b

Browse files
committed
Remove response_time references and preserve tuple response
1 parent 56c0933 commit 9ecdd8b

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

src/mainWindow.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -406,19 +406,15 @@ def updateRPCstatus(self, ctrl, fDebug=False):
406406

407407
try:
408408
rpcClient = RpcClient(rpc_protocol, rpc_host, rpc_user, rpc_password)
409-
status, statusMess, lastBlock, r_time1, isTestnet = rpcClient.getStatus()
410-
isBlockchainSynced, r_time2 = rpcClient.isBlockchainSynced()
409+
status, statusMess, lastBlock, isTestnet = rpcClient.getStatus()
410+
isBlockchainSynced = rpcClient.isBlockchainSynced()
411411
except Exception as e:
412412
printException(getCallerName(), getFunctionName(), "exception updating RPC status:", str(e))
413413
# clear status
414414
self.rpcClient = None
415415
self.sig_clearRPCstatus.emit()
416416
return
417417

418-
rpcResponseTime = None
419-
if r_time1 is not None and r_time2 != 0:
420-
rpcResponseTime = round((r_time1 + r_time2) / 2, 3)
421-
422418
# Do not update status if the user has selected a different server since the start of updateRPCStatus()
423419
if rpc_index != self.header.rpcClientsBox.currentIndex():
424420
return
@@ -429,7 +425,6 @@ def updateRPCstatus(self, ctrl, fDebug=False):
429425
self.rpcLastBlock = lastBlock
430426
self.rpcStatusMess = statusMess
431427
self.isBlockchainSynced = isBlockchainSynced
432-
self.rpcResponseTime = rpcResponseTime
433428
# if testnet flag is changed, update api client and persist setting
434429
if isTestnet != self.isTestnetRPC:
435430
self.isTestnetRPC = isTestnet

src/rpcClient.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import threading
1212

1313
from constants import DEFAULT_PROTOCOL_VERSION, MINIMUM_FEE
14-
from misc import getCallerName, getFunctionName, printException, printDbg, now, timeThis
14+
from misc import getCallerName, getFunctionName, printException, printDbg, now
1515

1616

1717
def process_RPC_exceptions(func):
@@ -190,25 +190,26 @@ def getStatus(self):
190190
statusMess = "Unable to connect to a PIVX RPC server.\n"
191191
statusMess += "Either the local PIVX wallet is not open, or the remote RPC server is not responding."
192192
n = 0
193-
response_time = None
193+
response_time = None # keep placeholder to preserve return 5-tuple
194194
with self.lock:
195195
isTestnet = self.conn.getinfo()['testnet']
196-
n, response_time = timeThis(self.conn.getblockcount)
196+
n = self.conn.getblockcount()
197197
if n is None:
198198
n = 0
199199

200200
if n > 0:
201201
status = True
202202
statusMess = "Connected to PIVX Blockchain"
203203

204+
# Preserve 5-tuple (status, msg, height, response_time, isTestnet)
204205
return status, statusMess, n, response_time, isTestnet
205206

206207
@process_RPC_exceptions
207208
def isBlockchainSynced(self):
208209
res = False
209-
response_time = None
210+
response_time = None # keep placeholder to preserve return 5-tuple
210211
with self.lock:
211-
status, response_time = timeThis(self.conn.mnsync, 'status')
212+
status = self.conn.mnsync, 'status'
212213
if status is not None:
213214
res = status.get("IsBlockchainSynced")
214215

0 commit comments

Comments
 (0)