lnd
lnd copied to clipboard
localchans: recreate missing edge if not found
Change Description
Description of change / link to associated issue.If a node contains a channel, but doesn't have a corresponding edge in the graph database, updating the channel policy would fail. In this commit the edge is recreated if the channel exists. This ensures a node can recover from a missing edge in the graph database by calling updatechanpolicy
.
Alternative for https://github.com/lightningnetwork/lnd/pull/8768, namely option 2 in https://github.com/lightningnetwork/lnd/pull/8768#issuecomment-2143799767
Partially fixes https://github.com/lightningnetwork/lnd/issues/7261 by allowing to recreate the edge by calling updatechanpolicy
.
Steps to Test
- Create a node that has a channel with a missing edge
- Calling getchaninfo on this channel will fail
- Call updatechanpolicy on this channel
- Calling getchaninfo on this channel should succeed
I'm not sure how to create an integration test where I can modify the graph database to delete an edge in order to test this. Please advise.
Pull Request Checklist
Testing
- [x] Your PR passes all CI checks.
- [x] Tests covering the positive and negative (error paths) are included.
- [x] Bug fixes contain tests triggering the bug to prevent regressions.
Code Style and Documentation
- [x] The change obeys the Code Documentation and Commenting guidelines, and lines wrap at 80.
- [x] Commits follow the Ideal Git Commit Structure.
- [x] Any new logging statements use an appropriate subsystem and logging level.
- [x] Any new lncli commands have appropriate tags in the comments for the rpc in the proto file.
- [x] There is a change description in the release notes, or
[skip ci]
in the commit message for small changes.
📝 Please see our Contribution Guidelines for further guidance.