From dd73a4596eabc0d3730e2dddb9aa2be33e39b10d Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 13 Apr 2018 09:00:56 +0200 Subject: [PATCH] lnbase: communication privkey belongs to peer --- lib/lnbase.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/lnbase.py b/lib/lnbase.py index f4f5bc328..abd4c8584 100644 --- a/lib/lnbase.py +++ b/lib/lnbase.py @@ -249,10 +249,10 @@ def aiosafe(f): class Peer(PrintError): - def __init__(self, privkey, host, port, pubkey): + def __init__(self, host, port, pubkey): self.host = host self.port = port - self.privkey = privkey + self.privkey = os.urandom(32) + b"\x01" self.pubkey = pubkey self.read_buffer = b'' self.ping_time = 0 @@ -427,8 +427,7 @@ class LNWorker: #host, port, pubkey = ('localhost', '9735', subprocess.Popen("~/go/bin/lncli getinfo | jq -r .identity_pubkey", shell=True, stdout=subprocess.PIPE).communicate()[0].strip()) pubkey = binascii.unhexlify(pubkey) port = int(port) - privkey = os.urandom(32) + b"\x01" - self.peer = Peer(privkey, host, port, pubkey) + self.peer = Peer(host, port, pubkey) self.network.futures.append(asyncio.run_coroutine_threadsafe(self.peer.main_loop(), asyncio.get_event_loop())) def openchannel(self):