-
Notifications
You must be signed in to change notification settings - Fork 407
Move pending payment tracking to after the new HTLC flies #1109
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
Move pending payment tracking to after the new HTLC flies #1109
Conversation
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.
Nice catch!
2de839e
to
34e2ad5
Compare
Caught another super minor issue and pushed a trivial fix, also fixed build on older rustc. |
Codecov Report
@@ Coverage Diff @@
## main #1109 +/- ##
==========================================
- Coverage 90.68% 90.50% -0.19%
==========================================
Files 65 66 +1
Lines 34587 34707 +120
==========================================
+ Hits 31365 31410 +45
- Misses 3222 3297 +75
Continue to review full report at Codecov.
|
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 good. Primarily nits around style.
lightning/src/ln/payment_tests.rs
Outdated
} | ||
|
||
#[test] | ||
fn retry_on_init_fail() { |
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.
Test name doesn't seem to reflect what's happening in the test. How about expanding the test to reconnect the nodes and successfully send another payment? Then add another check showing the payment is being tracked. Could name the test tracks_pending_outbound_payment
.
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.
I just renamed it no_pending_leak_on_initial_send_failure
, I'm not sure what reconnecting and sending does - the point is that you can't retry at that point, not sending a full payment.
34e2ad5
to
f8b89a1
Compare
If we attempt to send a payment, but the HTLC cannot be send due to local channel limits, we'll provide the user an error but end up with an entry in our pending payment map. This will result in a memory leak as we'll never reclaim the pending payment map entry.
f8b89a1
to
a58c617
Compare
Squashed without changes, will land after CI:
|
If we attempt to send a payment, but the HTLC cannot be send due to
local channel limits, we'll provide the user an error but end up
with an entry in our pending payment map. This will result in a
memory leak as we'll never reclaim the pending payment map entry.