Add lncli command / RPC for manually setting channel state #5033
Thanks for taking a look! I've hopefully addressed your initial feedback.
OK, my main concern was around the following issue.
Say Alice/Bob have a channel and Alice/Charlie have a channel. If we disable the Alice/Bob channel from Alice's end but then immediately send a payment Charlie -> Bob (i.e. before Alice broadcasts the
Per discussion with @Roasbeef , we can proceed with the current PR and address the "eventual consistency" concern as a follow-up.
Add a new boolean parameter without changing any existing functionality. The parameter will be used to indicate whether a request to update a channel's status was made manually by a user (currently always false).
Add boolean parameter for test functions without changing any existing functionality. All current tests set manual = false, but Future tests can set manual = true to test manual requests to update channel state.
If a channel was manually disabled, subsequent automatic / background requests to update that channel's state will be ignored. A RequestAuto call restores automatic / background state management and indicates that such requests should no longer be ignored.
Update router.proto and rest-annotations.yaml, recompile protos, add a stub implementation to routerrpc.Server.
Allow router RPC requests to call into the ChanStatusManager to manually update channel state.
This refactor-only change makes the GetChanPointFundingTxid helper function available from sub-systems outside of the root lnd package.
Update UpdateChanStatus stub implementation to call into exposed ChanStatusManager methods in RouterBackend.