Skip to content

Commit 3b797f4

Browse files
authored
Merge pull request #262 from starius/silence-close-err
lndclient: silence expected close error on shutdown
2 parents a034275 + d93a6a5 commit 3b797f4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lnd_services.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,15 @@ func NewLndServices(cfg *LndServicesConfig) (*GrpcLndServices, error) {
332332

333333
cleanupConn := func() {
334334
closeErr := conn.Close()
335-
if closeErr != nil {
335+
switch {
336+
case closeErr == nil:
337+
// No error.
338+
339+
case errors.Is(closeErr, grpc.ErrClientConnClosing):
340+
log.Debugf("LND connection is already closing: %v",
341+
closeErr)
342+
343+
default:
336344
log.Errorf("Error closing lnd connection: %v", closeErr)
337345
}
338346
}

0 commit comments

Comments
 (0)