Skip to content

Commit b8b23e7

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 637fb88 commit b8b23e7

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
@@ -4338,7 +4338,7 @@ impl<Signer: Sign> Channel<Signer> {
43384338
// channel might have been used to route very small values (either by honest users or as DoS).
43394339
self.channel_value_satoshis * 1000 * 9 / 10,
43404340

4341-
self.holder_max_htlc_value_in_flight_msat
4341+
self.counterparty_max_htlc_value_in_flight_msat
43424342
);
43434343
}
43444344

0 commit comments

Comments
 (0)