Browse Source

aiorpcx: pass ssl context, sleep after connecting

3.3.3.1
Janus 6 years ago
committed by SomberNight
parent
commit
8080a713b2
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 6
      electrum/network.py

6
electrum/network.py

@ -58,9 +58,13 @@ class Interface(PrintError):
@util.aiosafe
async def run(self):
self.host, self.port, self.protocol = self.server.split(':')
async with aiorpcx.ClientSession(self.host, self.port) as session:
sslc = ssl.SSLContext(ssl.PROTOCOL_TLS) if self.protocol == 's' else None
async with aiorpcx.ClientSession(self.host, self.port, ssl=sslc) as session:
ver = await session.send_request('server.version', [ELECTRUM_VERSION, PROTOCOL_VERSION])
print(ver)
while True:
print("sleeping")
await asyncio.sleep(1)
def __init__(self, server):
self.exception = None

Loading…
Cancel
Save