Closed TheBlueMatt closed 1 week ago
So, if I'm not mistaken this can be done by subtracting the two reserve values in get_holder_max_htlc_value_in_flight_msat
(see https://github.com/rust-bitcoin/rust-lightning/blob/main/lightning/src/ln/channel.rs#L608).
However, while our reserve value can be retrieved by calling get_holder_selected_channel_reserve_satoshis
, I believe the counterparty's reserve value is only known after we received a corresponding AcceptChannel
message? This might be an issue since get_holder_max_htlc_value_in_flight_msat
is called before that, e.g., when a OpenChannel
message is constructed. So, might subtracting only our reserve value (or twice) be an option?
So, if I'm not mistaken this can be done by subtracting the two reserve values in get_holder_max_htlc_value_in_flight_msat (see https://github.com/rust-bitcoin/rust-lightning/blob/main/lightning/src/ln/channel.rs#L608).
Yep, basically.
However, while our reserve value can be retrieved by calling get_holder_selected_channel_reserve_satoshis, I believe the counterparty's reserve value is only known after we received a corresponding AcceptChannel message? This might be an issue since get_holder_max_htlc_value_in_flight_msat is called before that, e.g., when a OpenChannel message is constructed. So, might subtracting only our reserve value (or twice) be an option?
Ah, good point, maybe I misinterpreted their error?
Looking at it again, I wonder if they're just confusing themselves - the end of the message "channel capacity is 59100sat, which is below 2000000000msat" seems to imply that they have configured a minimum channel value of 2 million sats. This would simply imply that they're simply opening a channel that they don't want to accept.
Google seems to think the error message format comes from c-lightning, so I've asked over there https://github.com/ElementsProject/lightning/issues/4873.
Maybe not worth doing anything here until we get a response.
Seems users are still hitting this: https://github.com/fedimint/fedimint/issues/5880
Right, this seems like just a CLN issue that we can't do anything about. Closing as they need to fix it.
Got a channel open from a rando node which it didn't like our accept_channel parameters. I'm not 100% sure on the error message, but it looks like its mad that the max_htlc_value_in_flight_msat is the full channel, and not the channel - the two reserve values. Doesn't seem like there's any harm in just substracting the reserve values so we should do that.