lnhtlc: local update raw messages must not be deleted before acked

In recv_rev() previously all unacked_local_updates were deleted
as it was assumed that all of them have been acked at that point by
the revoke_and_ack itself. However this is not necessarily the case:
see new test case.

renamed log['unacked_local_updates'] to log['unacked_local_updates2']
to avoid breaking existing wallet files
This commit is contained in:
SomberNight
2019-08-12 18:37:13 +02:00
committed by ThomasV
parent 4fc9f243f7
commit a27b03be6d
4 changed files with 63 additions and 16 deletions

View File

@@ -88,7 +88,7 @@ def create_ephemeral_key() -> (bytes, bytes):
class LNTransportBase:
def send_bytes(self, msg):
def send_bytes(self, msg: bytes) -> None:
l = len(msg).to_bytes(2, 'big')
lc = aead_encrypt(self.sk, self.sn(), b'', l)
c = aead_encrypt(self.sk, self.sn(), b'', msg)