-
Notifications
You must be signed in to change notification settings - Fork 411
Drop useless SCID lookup in claim_funds_from_hop
#1885
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
Drop useless SCID lookup in claim_funds_from_hop
#1885
Conversation
We have the channel_id available in `prev_hop` so there's no reason to look it up by SCID.
Codecov ReportBase: 90.73% // Head: 90.70% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1885 +/- ##
==========================================
- Coverage 90.73% 90.70% -0.03%
==========================================
Files 91 91
Lines 48042 48039 -3
Branches 48042 48039 -3
==========================================
- Hits 43589 43576 -13
- Misses 4453 4463 +10
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View 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.
LGTM
@@ -3729,7 +3729,7 @@ impl<M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManager<M, T, K, F | |||
htlc.timer_ticks += 1; | |||
return htlc.timer_ticks >= MPP_TIMEOUT_TICKS | |||
}) { | |||
timed_out_mpp_htlcs.extend(htlcs.into_iter().map(|htlc| (htlc.prev_hop.clone(), payment_hash.clone()))); | |||
timed_out_mpp_htlcs.extend(htlcs.drain(..).map(|htlc: ClaimableHTLC| (htlc.prev_hop, *payment_hash))); |
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.
my bad 😅
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.
The real Clone Wars™
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.
Reviewers should have pointed it out :)
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! I'll end up passing the actual inner PeerState
to claim_funds_from_hop
with #1507, so the counterparty_node_id
from short_to_chan_info
shouldn't be needed in the function either.
I may race you to that one and change the locking semantics there, but we can probably land 1507 first. |
We have the channel_id available in
prev_hop
so there's no reason to look it up by SCID.