1
0

ln: add two trimming tests, avoid negative numbers in htlc trim decision

This commit is contained in:
Janus
2018-07-06 18:55:17 +02:00
committed by ThomasV
parent 03c2b954d9
commit 605d6ff5ca
3 changed files with 118 additions and 125 deletions

View File

@@ -851,10 +851,8 @@ class Peer(PrintError):
self.attempted_route[(chan.channel_id, htlc.htlc_id)] = route
sig_64, htlc_sigs = chan.sign_next_commitment()
htlc_sig = htlc_sigs[0]
self.send_message(gen_msg("commitment_signed", channel_id=chan.channel_id, signature=sig_64, num_htlcs=1, htlc_signature=htlc_sig))
self.send_message(gen_msg("commitment_signed", channel_id=chan.channel_id, signature=sig_64, num_htlcs=len(htlc_sigs), htlc_signature=b"".join(htlc_sigs)))
await self.receive_revoke(chan)
self.revoke(chan)