mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
interface: minor clean-up split out _set_proxy from init
This commit is contained in:
parent
c40468a8d3
commit
c93d137c5e
1 changed files with 6 additions and 4 deletions
|
@ -139,6 +139,7 @@ class Interface(PrintError):
|
||||||
self.cert_path = os.path.join(self.config_path, 'certs', self.host)
|
self.cert_path = os.path.join(self.config_path, 'certs', self.host)
|
||||||
self.blockchain = None
|
self.blockchain = None
|
||||||
self.network = network
|
self.network = network
|
||||||
|
self._set_proxy(proxy)
|
||||||
|
|
||||||
self.tip_header = None
|
self.tip_header = None
|
||||||
self.tip = 0
|
self.tip = 0
|
||||||
|
@ -147,6 +148,10 @@ class Interface(PrintError):
|
||||||
self.fut = asyncio.get_event_loop().create_task(self.run())
|
self.fut = asyncio.get_event_loop().create_task(self.run())
|
||||||
self.group = SilentTaskGroup()
|
self.group = SilentTaskGroup()
|
||||||
|
|
||||||
|
def diagnostic_name(self):
|
||||||
|
return self.host
|
||||||
|
|
||||||
|
def _set_proxy(self, proxy: dict):
|
||||||
if proxy:
|
if proxy:
|
||||||
username, pw = proxy.get('user'), proxy.get('password')
|
username, pw = proxy.get('user'), proxy.get('password')
|
||||||
if not username or not pw:
|
if not username or not pw:
|
||||||
|
@ -162,9 +167,6 @@ class Interface(PrintError):
|
||||||
else:
|
else:
|
||||||
self.proxy = None
|
self.proxy = None
|
||||||
|
|
||||||
def diagnostic_name(self):
|
|
||||||
return self.host
|
|
||||||
|
|
||||||
async def is_server_ca_signed(self, sslc):
|
async def is_server_ca_signed(self, sslc):
|
||||||
try:
|
try:
|
||||||
await self.open_session(sslc, exit_early=True)
|
await self.open_session(sslc, exit_early=True)
|
||||||
|
|
Loading…
Add table
Reference in a new issue