Skip to content

Commit f6005ed

Browse files
authored
Merge pull request #10352 from starius/chainnotifier-unavallable
chainrpc: return Unavailable while notifier starts
2 parents af6816b + e4313eb commit f6005ed

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

docs/release-notes/release-notes-0.20.0.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@
5959
- [Fixed a bug](https://github.com/lightningnetwork/lnd/pull/10330) to ensure that goroutine resources are properly freed in the case
6060
of a disconnection or other failure event.
6161

62+
- Chain notifier RPCs now [return the gRPC `Unavailable`
63+
status](https://github.com/lightningnetwork/lnd/pull/10352) while the
64+
sub-server is still starting. This allows clients to reliably detect the
65+
transient condition and retry without brittle string matching.
66+
6267
# New Features
6368

6469
* Use persisted [nodeannouncement](https://github.com/lightningnetwork/lnd/pull/8825)
@@ -283,7 +288,7 @@ reader of a payment request.
283288
* [Require invoices to include a payment address or blinded paths](https://github.com/lightningnetwork/lnd/pull/9752)
284289
to comply with updated BOLT 11 specifications before sending payments.
285290

286-
* [LND can now recgonize DNS address type in node
291+
* [LND can now recognize DNS address type in node
287292
announcement msg](https://github.com/lightningnetwork/lnd/pull/9455). This
288293
allows users to forward node announcement with valid DNS address types. The
289294
validity aligns with Bolt 07 DNS constraints.

lnrpc/chainrpc/chain_server.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import (
1818
"github.com/lightningnetwork/lnd/lnrpc"
1919
"github.com/lightningnetwork/lnd/macaroons"
2020
"google.golang.org/grpc"
21+
"google.golang.org/grpc/codes"
22+
"google.golang.org/grpc/status"
2123
"gopkg.in/macaroon-bakery.v2/bakery"
2224
)
2325

@@ -84,8 +86,8 @@ var (
8486

8587
// ErrChainNotifierServerNotActive indicates that the chain notifier hasn't
8688
// finished the startup process.
87-
ErrChainNotifierServerNotActive = errors.New("chain notifier RPC is " +
88-
"still in the process of starting")
89+
ErrChainNotifierServerNotActive = status.Error(codes.Unavailable,
90+
"chain notifier RPC is still in the process of starting")
8991
)
9092

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

0 commit comments

Comments
 (0)