Skip to content

Commit 5c7bfa7

Browse files
Set ChannelUpdate htlc_maximum_msat using the peer's value
Use the `counterparty_max_htlc_value_in_flight_msat` value, and not the `holder_max_htlc_value_in_flight_msat` value when creating the `htlc_maximum_msat` value for `ChannelUpdate` messages. BOLT 7 specifies that the field MUST be less than or equal to `max_htlc_value_in_flight_msat` received from the peer, which we currently are not guaranteed to adhere to by using the holder value.
1 parent d13061c commit 5c7bfa7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning/src/ln/channel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4379,7 +4379,7 @@ impl<Signer: Sign> Channel<Signer> {
43794379
// channel might have been used to route very small values (either by honest users or as DoS).
43804380
self.channel_value_satoshis * 1000 * 9 / 10,
43814381

4382-
self.holder_max_htlc_value_in_flight_msat
4382+
self.counterparty_max_htlc_value_in_flight_msat
43834383
);
43844384
}
43854385

0 commit comments

Comments
 (0)