Skip to content

Commit 1d7b4c0

Browse files
committed
terminal: make startup infor compatible with lnd 0.13
If the wallet is locked, lnd 0.13 returns a new error now. To catch this and not error out when trying to find out the wallet status on startup, we use the new IsUnlockError of lndclient.
1 parent fe0b446 commit 1d7b4c0

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

terminal.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ import (
4141
"github.com/lightningnetwork/lnd/lntest/wait"
4242
"github.com/lightningnetwork/lnd/signal"
4343
"google.golang.org/grpc"
44-
"google.golang.org/grpc/codes"
4544
"google.golang.org/grpc/credentials"
46-
"google.golang.org/grpc/status"
4745
"gopkg.in/macaroon-bakery.v2/bakery"
4846
)
4947

@@ -912,10 +910,7 @@ func (g *LightningTerminal) showStartupInfo() error {
912910
ctx := context.Background()
913911
res, err := basicClient.GetInfo(ctx, &lnrpc.GetInfoRequest{})
914912
if err != nil {
915-
s, ok := status.FromError(err)
916-
if !ok || s.Code() != codes.Unimplemented {
917-
// Some other error that we didn't expect at
918-
// this moment.
913+
if !lndclient.IsUnlockError(err) {
919914
return fmt.Errorf("error querying remote "+
920915
"node : %v", err)
921916
}

0 commit comments

Comments
 (0)