Browse Source
aiorpcx: pass ssl context, sleep after connecting
3.3.3.1
Janus
6 years ago
committed by
SomberNight
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
1 changed files with
5 additions and
1 deletions
-
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 |
|
|
|