lncli: show fee_per_vbyte and local_close_tx in closechannel and closeallchannels output
Change Description
This PR updates the lncli closechannel and closeallchannels commands to include fee_per_vbyte and local_close_tx in their JSON output when available.
- Refactors
executeChannelCloseto send all close details (txid, fee, local flag) via a struct. - Ensures both single and batch close flows print these fields in their output.
Fixes #9831
Steps to Test
- Open a channel and close it using
lncli closechannelwith a custom fee. - Confirm the JSON output includes
closing_txid,fee_per_vbyte, andlocal_close_tx. - Run
lncli closeallchannelsand confirm the output for each channel includes the new fields.
Pull Request Checklist
Testing
- [ ] Your PR passes all CI checks.
- [ ] Tests covering the positive and negative (error paths) are included.
- [ ] Bug fixes contain tests triggering the bug to prevent regressions.
Code Style and Documentation
- [x] The change is not insubstantial. Typo fixes are not accepted to fight bot spam.
- [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.
- [ ] 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.
Summary of Changes
Hello @Suvrat1629, I'm Gemini Code Assist[^1]! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request significantly improves the user experience for lncli channel closing commands by enriching their JSON output. Users can now immediately access critical information such as the transaction fee per vbyte and whether the closure was initiated locally or remotely, directly from the closechannel and closeallchannels commands. This enhancement provides more comprehensive details for better monitoring and automation of channel management.
Highlights
- Enhanced lncli Output: The
lncli closechannelandcloseallchannelscommands now includefee_per_vbyteandlocal_close_txin their JSON output, providing more detailed information about channel closures. - Refactored Channel Closing Logic: The
executeChannelClosefunction has been refactored to pass all channel closing details (transaction ID, fee, and local/remote flag) via a dedicatedCloseInfostruct, improving data encapsulation. - Consistent Information Across Commands: Both single channel and batch channel closing operations now consistently display these new fields in their output, ensuring a uniform user experience.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
[^1]: Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.
@nishantbansal2003: review reminder @suvrat1629, remember to re-request review from reviewers when ready