lnd icon indicating copy to clipboard operation
lnd copied to clipboard

lncli: show fee_per_vbyte and local_close_tx in closechannel and closeallchannels output

Open Suvrat1629 opened this issue 2 months ago • 2 comments

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 executeChannelClose to 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

  1. Open a channel and close it using lncli closechannel with a custom fee.
  2. Confirm the JSON output includes closing_txid, fee_per_vbyte, and local_close_tx.
  3. Run lncli closeallchannels and 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

📝 Please see our Contribution Guidelines for further guidance.

Suvrat1629 avatar Oct 18 '25 05:10 Suvrat1629

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 closechannel and closeallchannels commands now include fee_per_vbyte and local_close_tx in their JSON output, providing more detailed information about channel closures.
  • Refactored Channel Closing Logic: The executeChannelClose function has been refactored to pass all channel closing details (transaction ID, fee, and local/remote flag) via a dedicated CloseInfo struct, 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.

gemini-code-assist[bot] avatar Oct 18 '25 05:10 gemini-code-assist[bot]

@nishantbansal2003: review reminder @suvrat1629, remember to re-request review from reviewers when ready

lightninglabs-deploy avatar Dec 16 '25 16:12 lightninglabs-deploy