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 committed 2021-02-24 07:13:28 -08:00
1 parent 4e4f4bc194
commit db76b970ac
2 files changed
+18 -1

No files matched your search

+7
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 {