Skip to content

Commit f4d6dc4

Browse files
committed
chainrpc: return Unavailable while notifier starts
From v0.20.0-rc3 (commit c6f458e) onward the ChainNotifier sub-server may still be initialising when clients attempt to subscribe, currently resulting in a gRPC Unknown error with a plain-text message. Change the notifier RPC endpoints to return codes.Unavailable instead so clients can reliably interpret the condition as "retry later" and handle the startup lag without unstable string matching.
1 parent 096ab65 commit f4d6dc4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lnrpc/chainrpc/chain_server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ var (
8484

8585
// ErrChainNotifierServerNotActive indicates that the chain notifier hasn't
8686
// finished the startup process.
87-
ErrChainNotifierServerNotActive = errors.New("chain notifier RPC is " +
88-
"still in the process of starting")
87+
ErrChainNotifierServerNotActive = status.Error(codes.Unavailable,
88+
"chain notifier RPC is still in the process of starting")
8989
)
9090

9191
// ServerShell is a shell struct holding a reference to the actual sub-server.

0 commit comments

Comments
 (0)