Skip to content

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

Merged
merged 2 commits into from
Nov 30, 2022

Conversation

TheBlueMatt
Copy link
Collaborator

We have the channel_id available in prev_hop so there's no reason to look it up by SCID.

We have the channel_id available in `prev_hop` so there's no reason
to look it up by SCID.
@codecov-commenter
Copy link

codecov-commenter commented Nov 30, 2022

Codecov Report

Base: 90.73% // Head: 90.70% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (e7ba103) compared to base (2c57878).
Patch coverage: 100.00% of modified lines in pull request are covered.

❗ Current head e7ba103 differs from pull request most recent head 3e88b72. Consider uploading reports for the commit 3e88b72 to get more accurate results

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     
Impacted Files Coverage Δ
lightning/src/ln/channelmanager.rs 86.38% <100.00%> (+0.01%) ⬆️
lightning-net-tokio/src/lib.rs 76.73% <0.00%> (-0.31%) ⬇️
lightning/src/chain/onchaintx.rs 95.08% <0.00%> (-0.22%) ⬇️
lightning/src/ln/functional_tests.rs 96.98% <0.00%> (-0.15%) ⬇️
lightning/src/ln/monitor_tests.rs 99.46% <0.00%> (-0.11%) ⬇️
lightning/src/util/events.rs 26.21% <0.00%> (+0.24%) ⬆️

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.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@dunxen dunxen left a 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)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad 😅

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The real Clone Wars™

Copy link
Collaborator Author

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 :)

Copy link
Contributor

@ViktorTigerstrom ViktorTigerstrom left a 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.

@TheBlueMatt
Copy link
Collaborator Author

Nice! I'll end up passing the actual inner PeerState to claim_funds_from_hop with #1507,

I may race you to that one and change the locking semantics there, but we can probably land 1507 first.

@TheBlueMatt TheBlueMatt merged commit 440c3ee into lightningdevkit:main Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants