qa: Drop RPC connection if --usecli
This commit is contained in:
parent
5029e94f85
commit
6440e61375
1 changed files with 6 additions and 3 deletions
|
@ -209,12 +209,15 @@ class TestNode():
|
||||||
raise FailedToStartError(self._node_msg(
|
raise FailedToStartError(self._node_msg(
|
||||||
'bitcoind exited with status {} during initialization'.format(self.process.returncode)))
|
'bitcoind exited with status {} during initialization'.format(self.process.returncode)))
|
||||||
try:
|
try:
|
||||||
self.rpc = get_rpc_proxy(rpc_url(self.datadir, self.index, self.rpchost), self.index, timeout=self.rpc_timeout, coveragedir=self.coverage_dir)
|
rpc = get_rpc_proxy(rpc_url(self.datadir, self.index, self.rpchost), self.index, timeout=self.rpc_timeout, coveragedir=self.coverage_dir)
|
||||||
self.rpc.getblockcount()
|
rpc.getblockcount()
|
||||||
# If the call to getblockcount() succeeds then the RPC connection is up
|
# If the call to getblockcount() succeeds then the RPC connection is up
|
||||||
|
self.log.debug("RPC successfully started")
|
||||||
|
if self.use_cli:
|
||||||
|
return
|
||||||
|
self.rpc = rpc
|
||||||
self.rpc_connected = True
|
self.rpc_connected = True
|
||||||
self.url = self.rpc.url
|
self.url = self.rpc.url
|
||||||
self.log.debug("RPC successfully started")
|
|
||||||
return
|
return
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
if e.errno != errno.ECONNREFUSED: # Port not yet open?
|
if e.errno != errno.ECONNREFUSED: # Port not yet open?
|
||||||
|
|
Loading…
Reference in a new issue