Skip to content

Move short-to-chan-info follow ups #1795

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

Conversation

ViktorTigerstrom
Copy link
Contributor

This PR is based on #1639 and moves some of the follow-ups from #1639 into a separate PR.
See comment #1639 (comment)

If you think it makes more sense to include these changes in #1639 instead, let me know and I'll close this PR.

As the `channel_state` (`ChannelHolder`) struct will be removed, this
commit moves the `short_to_chan_info` map from that lock into a seperate
lock.
After lightningdevkit#1639 was merged, the `channel_state` lock is no longer an Option
value in `claim_funds`. Update this PR to use the already unwrapped
variable.
As the `short_to_chan_info` has been moved out of the `channel_state` to
a standalone lock, several macros no longer need the `channel_state`
passed into the macro.
As the `short_to_chan_info` map has been removed from the
`channel_state`, there is no longer any consistency guarantees between
the `by_id` and `short_to_chan_info` maps. This commit ensures that we
don't force unwrap channels where the channel_id has been queried from
the `short_to_chan_info` map.
Refactor `process_pending_htlc_forwards` to ensure that both branches
that fails `pending_forwards` are placed next to eachother for improved
readability.
@ViktorTigerstrom ViktorTigerstrom marked this pull request as ready for review October 23, 2022 18:04
@codecov-commenter
Copy link

Codecov Report

Base: 90.74% // Head: 90.70% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (ff45b40) compared to base (fc9a4c2).
Patch coverage: 74.60% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1795      +/-   ##
==========================================
- Coverage   90.74%   90.70%   -0.04%     
==========================================
  Files          87       87              
  Lines       47353    47348       -5     
  Branches    47353    47348       -5     
==========================================
- Hits        42969    42947      -22     
- Misses       4384     4401      +17     
Impacted Files Coverage Δ
lightning/src/ln/channelmanager.rs 85.12% <74.19%> (-0.07%) ⬇️
lightning/src/ln/reorg_tests.rs 100.00% <100.00%> (ø)
lightning/src/chain/onchaintx.rs 94.17% <0.00%> (-1.13%) ⬇️
lightning-net-tokio/src/lib.rs 76.73% <0.00%> (-0.31%) ⬇️
lightning/src/ln/functional_tests.rs 96.87% <0.00%> (-0.14%) ⬇️

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.

@ViktorTigerstrom
Copy link
Contributor Author

Closing this as the changes have now been included in #1639 once again.

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.

2 participants