From 3da09aac0e226f6e9e05b9fc639ca1b33b505a90 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Wed, 22 Apr 2020 15:48:34 +0200 Subject: [PATCH] client: use cached info to log connected node --- client.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/client.go b/client.go index 3230802..cc39219 100644 --- a/client.go +++ b/client.go @@ -2,9 +2,7 @@ package loop import ( "context" - "encoding/hex" "errors" - "fmt" "strings" "sync" "sync/atomic" @@ -211,13 +209,9 @@ func (s *Client) Run(ctx context.Context, } // Log connected node. - info, err := s.lndServices.Client.GetInfo(ctx) - if err != nil { - return fmt.Errorf("GetInfo error: %v", err) - } - log.Infof("Connected to lnd node %v with pubkey %v", - info.Alias, hex.EncodeToString(info.IdentityPubkey[:]), - ) + log.Infof("Connected to lnd node '%v' with pubkey %x (version %s)", + s.lndServices.NodeAlias, s.lndServices.NodePubkey, + lndclient.VersionString(s.lndServices.Version)) // Setup main context used for cancelation. mainCtx, mainCancel := context.WithCancel(ctx)