Skip to content

Commit

Permalink
terminal: allow lnd GetState RPC on Wallet Ready
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorTigerstrom committed Dec 14, 2023
1 parent 59b65e5 commit a41e8f8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,18 @@ func (g *LightningTerminal) Run() error {
return fmt.Errorf("could not create permissions manager")
}

lndOverride := func(uri, manualStatus string) (bool, bool) {
if uri != "/lnrpc.State/GetState" {
return false, false
}

return manualStatus == lndWalletReadyStatus, true
}

// Register LND, LiT and Accounts with the status manager.
g.statusMgr.RegisterAndEnableSubServer(subservers.LND)
g.statusMgr.RegisterAndEnableSubServer(
subservers.LND, status.WithIsReadyOverride(lndOverride),
)
g.statusMgr.RegisterAndEnableSubServer(subservers.LIT)
g.statusMgr.RegisterSubServer(subservers.ACCOUNTS)

Expand Down

0 comments on commit a41e8f8

Please sign in to comment.