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.
This commit is contained in:
Oliver Gugger 2021-05-19 14:35:30 +02:00
parent fe0b446d38
commit 1d7b4c07ee
No known key found for this signature in database
GPG key ID: 8E4256593F177720

View file

@ -41,9 +41,7 @@ import (
"github.com/lightningnetwork/lnd/lntest/wait"
"github.com/lightningnetwork/lnd/signal"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/status"
"gopkg.in/macaroon-bakery.v2/bakery"
)
@ -912,10 +910,7 @@ func (g *LightningTerminal) showStartupInfo() error {
ctx := context.Background()
res, err := basicClient.GetInfo(ctx, &lnrpc.GetInfoRequest{})
if err != nil {
s, ok := status.FromError(err)
if !ok || s.Code() != codes.Unimplemented {
// Some other error that we didn't expect at
// this moment.
if !lndclient.IsUnlockError(err) {
return fmt.Errorf("error querying remote "+
"node : %v", err)
}