You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When value_to_holder: i64 or value_to_counterparty: i64 are negative (funder doesn't have enough channel balance to pay the total_fee_satoshis) they'll underflow at the _ as u64 conversion.
Adding some logs, you can see:
// context
[lightning/src/ln/channel.rs:4004:3] holder_balance = 2500
[lightning/src/ln/channel.rs:4004:3] counterparty_balance = 17500
// first block
[lightning/src/ln/channel.rs:4004:3] total_fee_satoshis = 3053
[lightning/src/ln/channel.rs:4004:3] value_to_holder = -553
[lightning/src/ln/channel.rs:4004:3] value_to_counterparty = 17500
// after if blocks
[lightning/src/ln/channel.rs:4022:3] total_fee_satoshis = 3606
[lightning/src/ln/channel.rs:4022:3] value_to_holder as u64 = 18446744073709551063
[lightning/src/ln/channel.rs:4022:3] value_to_counterparty as u64 = 17500
Fortunately the remote just force closes, so it doesn't seem too problematic.
The text was updated successfully, but these errors were encountered:
Good point, yea we should debug_assert on that not underflowing and if it does in prod just force-close the channel. I don't believe that underflow is actually reachable.
Hey, was taking a look at channel close fees today and noticed something funky in
Channel::build_closing_transaction
.When
value_to_holder: i64
orvalue_to_counterparty: i64
are negative (funder doesn't have enough channel balance to pay thetotal_fee_satoshis
) they'll underflow at the_ as u64
conversion.Adding some logs, you can see:
Fortunately the remote just force closes, so it doesn't seem too problematic.
The text was updated successfully, but these errors were encountered: