-
Notifications
You must be signed in to change notification settings - Fork 404
Include inbound-claimed-HTLCs in reported channel balances #1268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include inbound-claimed-HTLCs in reported channel balances #1268
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1268 +/- ##
==========================================
+ Coverage 90.40% 91.96% +1.55%
==========================================
Files 71 71
Lines 38135 47519 +9384
==========================================
+ Hits 34476 43700 +9224
- Misses 3659 3819 +160
Continue to review full report at Codecov.
|
83588a3
to
584920c
Compare
Added a test, while adding it I discovered this is even harder to hit than I thought, you have to write a custom router on top and can only happen on the first HTLC after open cause otherwise the reserve value protects us against underflow. Would still be nice to land for 105, but its really hard to hit. |
Given the balance is reported as "total balance if we went to chain ignoring fees", it seems reasonable to include claimed HTLCs - if we went to chain we'd get those funds, less on-chain fees. Further, if we do not include them, its possible to have pending outbound holding-cell HTLCs underflow the balance calculation, causing a panic in debug mode, and bogus values in release. This resolves a subtraction underflow bug found by the `chanmon_consistency` fuzz target.
1818c4a
584920c
to
1818c4a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great
Given the balance is reported as "total balance if we went to chain
ignoring fees", it seems reasonable to include claimed HTLCs - if
we went to chain we'd get those funds, less on-chain fees. Further,
if we do not include them, its possible to have pending outbound
holding-cell HTLCs underflow the balance calculation, causing a
panic in debug mode, and bogus values in release.
This resolves a subtraction underflow bug found by the
chanmon_consistency
fuzz target.