Skip to content

Commit f1d5fdf

Browse files
sr-girustyrussell
authored andcommitted
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
1 parent 26c10ff commit f1d5fdf

File tree

1 file changed

+2
-1
lines changed
  • contrib/pyln-proto/pyln/proto

1 file changed

+2
-1
lines changed

contrib/pyln-proto/pyln/proto/wire.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,9 @@ def handshake_act_three_responder(self, m):
267267
raise ValueError("Unsupported handshake version {}, only version "
268268
"0 is supported.".format(v))
269269
rs = decryptWithAD(self.temp_k2, self.nonce(1), h.digest(), c)
270+
self.remote_pubkey = PublicKey(rs)
270271
h.update(c)
271-
se = ecdh(self.handshake['e'], PublicKey(rs))
272+
se = ecdh(self.handshake['e'], self.remote_pubkey)
272273

273274
self.chaining_key, self.temp_k3 = hkdf_two_keys(
274275
se.raw, self.chaining_key

0 commit comments

Comments
 (0)