Skip to content

Commit 0c3c62a

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 3f209b7 commit 0c3c62a

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

4360-
self.holder_max_htlc_value_in_flight_msat
4360+
self.counterparty_max_htlc_value_in_flight_msat
43614361
);
43624362
}
43634363

0 commit comments

Comments
 (0)