routerrpc: expose SetChannel* methods from Router backend

Allow router RPC requests to call into the ChanStatusManager to
manually update channel state.
This commit is contained in:
Elliott Jin
2021-02-12 23:29:13 -08:00
parent 4e4f4bc194
commit db76b970ac
2 changed files with 18 additions and 1 deletions

View File

@@ -602,6 +602,13 @@ func newRPCServer(cfg *Config, s *server, macService *macaroons.Service,
DefaultFinalCltvDelta: uint16(cfg.Bitcoin.TimeLockDelta),
SubscribeHtlcEvents: s.htlcNotifier.SubscribeHtlcEvents,
InterceptableForwarder: s.interceptableSwitch,
SetChannelEnabled: func(outpoint wire.OutPoint) error {
return s.chanStatusMgr.RequestEnable(outpoint, true)
},
SetChannelDisabled: func(outpoint wire.OutPoint) error {
return s.chanStatusMgr.RequestDisable(outpoint, true)
},
SetChannelAuto: s.chanStatusMgr.RequestAuto,
}
genInvoiceFeatures := func() *lnwire.FeatureVector {