-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
lnrpc: include a status indicator for channel verification operations #7476
lnrpc: include a status indicator for channel verification operations #7476
Conversation
I also wonder if we want to keep it so that the verification returns an error directly or whether the rpc response can set |
I don't think we want to change that behavior. When using RPCs programmatically you want to be sure that you get an RPC error back when something goes wrong. If there is no error, you can assume that everything was fine. That's the reason why the original response was empty, because there can only ever be failure or success (which makes sense on an API level but looks weird on the command line). So this PR is purely cosmetic for the CLI user but shouldn't change the RPC/API behavior. Code looks like it should be working, but can you add a check here that the return value is |
d7a8026
to
102ba21
Compare
@guggero Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM 🎉
Just two small nits remaining.
71cbc19
to
468cf83
Compare
@@ -7148,7 +7148,9 @@ func (r *rpcServer) VerifyChanBackup(ctx context.Context, | |||
} | |||
} | |||
|
|||
return &lnrpc.VerifyChanBackupResponse{}, nil | |||
return &lnrpc.VerifyChanBackupResponse{ | |||
Success: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this ever be false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is purely to improve the output on the command line (which currently is just empty braces).
@ardevd can you rebase this on top of the |
Of course. However, having spent more time with lnd I realize that the empty json responses are used quite extensively to indicate a successful operation. Introducing a "success" indicator for backup verification alone might add more confusion than clarity. Any thoughts @guggero ? |
Yes, it takes some getting used to, but eventually it's easy to interpret the "no error message means success" pattern of |
Agreed. Makes more sense than to effectively have a hardcoded Boolean value. It would actually be pretty useful to get an indication of the number of channel points that were indeed processed/verified. |
Should we rebase this, update the |
I can take this over for 0.17. Would be nice to get a list of channel points contained in a backup instead of just a boolean value. @ardevd do you plan on continuing with this or should I take it over? |
I'd love to work on this but am currently pretty time constrained. Happy for you to take it over @guggero :) |
@ardevd, remember to re-request review from reviewers when ready |
Closed due to inactivity. |
Change Description
Description of change / link to associated issue.
Steps to Test
Response now includes a
success
indicator.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.