pyln: Sets remote_pubkey for LightningConnection if node is not the initiator

Currently ``LightningConnection.remote_pubkey`` is set to ``None`` if the node is not the handshake initiator. This sets it to ``rs`` in act three from the receiver side
This commit is contained in:
Sergi Delgado Segura 2020-09-11 11:44:26 +02:00 committed by Rusty Russell
parent 26c10ffefe
commit f1d5fdf323

View file

@ -267,8 +267,9 @@ class LightningConnection(object):
raise ValueError("Unsupported handshake version {}, only version "
"0 is supported.".format(v))
rs = decryptWithAD(self.temp_k2, self.nonce(1), h.digest(), c)
self.remote_pubkey = PublicKey(rs)
h.update(c)
se = ecdh(self.handshake['e'], PublicKey(rs))
se = ecdh(self.handshake['e'], self.remote_pubkey)
self.chaining_key, self.temp_k3 = hkdf_two_keys(
se.raw, self.chaining_key