Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/test_node.py
Show First 20 Lines • Show All 221 Lines • ▼ Show 20 Lines | def wait_for_rpc_connection(self): | ||||
self.rpc_connected = True | self.rpc_connected = True | ||||
self.url = self.rpc.url | self.url = self.rpc.url | ||||
self.log.debug("RPC successfully started") | 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? | ||||
raise # unknown IO error | raise # unknown IO error | ||||
except JSONRPCException as e: # Initialization phase | except JSONRPCException as e: # Initialization phase | ||||
if e.error['code'] != -28: # RPC in warmup? | # -28 RPC in warmup | ||||
# -342 Service unavailable, RPC server started but is shutting down due to error | |||||
if e.error['code'] != -28 and e.error['code'] != -342: | |||||
raise # unknown JSON RPC exception | raise # unknown JSON RPC exception | ||||
except ValueError as e: # cookie file not found and no rpcuser or rpcassword. bitcoind still starting | except ValueError as e: # cookie file not found and no rpcuser or rpcassword. bitcoind still starting | ||||
if "No RPC credentials" not in str(e): | if "No RPC credentials" not in str(e): | ||||
raise | raise | ||||
time.sleep(1.0 / poll_per_s) | time.sleep(1.0 / poll_per_s) | ||||
self._raise_assertion_error("Unable to connect to bitcoind") | self._raise_assertion_error("Unable to connect to bitcoind") | ||||
def get_wallet_rpc(self, wallet_name): | def get_wallet_rpc(self, wallet_name): | ||||
▲ Show 20 Lines • Show All 252 Lines • Show Last 20 Lines |