lnwallet: improve ErrBelowChanReserve error message#10607
lnwallet: improve ErrBelowChanReserve error message#10607Euler-B wants to merge 1 commit intolightningnetwork:masterfrom
Conversation
Summary of ChangesHello @Euler-B, I'm Gemini Code Assist1! 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 focuses on enhancing user understanding by refining an existing error message. The change to Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe 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
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 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 👍 and 👎 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. Footnotes
|
lnwallet/channel.go
Outdated
| ErrBelowChanReserve = fmt.Errorf("Cannot spend due to channel " + | ||
| "reserve: commitment transaction dips peer below chan reserve") |
There was a problem hiding this comment.
This improves the error message for users. To make it even more concise and avoid repeating the word 'reserve', consider rephrasing the entire message. The technical detail about the 'commitment transaction' might not be necessary for an end-user facing error.
| ErrBelowChanReserve = fmt.Errorf("Cannot spend due to channel " + | |
| "reserve: commitment transaction dips peer below chan reserve") | |
| ErrBelowChanReserve = fmt.Errorf("cannot send payment: " + | |
| "peer's balance would be below channel reserve") |
This commit modifies the ErrBelowChanReserve error to provide more context to the user. It explicitly states that the lack of spendable balance is due to the channel reserve constraint. Fixes issue lightningnetwork#8957
447dbee to
5e2dae7
Compare
🔴 PR Severity: CRITICAL
🔴 Critical (1 file)
AnalysisThis PR modifies The change is minimal in scope (2 additions, 2 deletions in a single file), which reduces risk, but the package classification alone mandates CRITICAL severity per policy. To override, add a |
Change Description
This PR modifies the
ErrBelowChanReserveerror message to provide more context to the user. Previously, the error only stated"commitment transaction dips peer below chan reserve", which could be slightly ambiguous for end users wondering why their logical balance was insufficient for a payment. By explicitly prepending"Cannot spend due to channel reserve:", it becomes immediately clear that the payment routing constraint is dictated by the channel reserve limit.Fixes #8957.
Steps to Test
lnwallettest suite to ensure no regressions were introduced by the error string change:lnclior the RPC interface."Cannot spend due to channel reserve: commitment transaction dips peer below chan reserve".Pull Request Checklist
Testing
Code Style and Documentation
[skip ci]in the commit message for small changes.📝 Please see our Contribution Guidelines for further guidance.