Skip to content

Commit 04a63fd

Browse files
stariusViktorT-11
andauthored
Update lnd_services.go
Co-authored-by: Viktor Torstensson <[email protected]>
1 parent efe0aa0 commit 04a63fd

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

lnd_services.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -610,25 +610,22 @@ func (s *GrpcLndServices) waitForChainNotifier(ctx context.Context,
610610
"the current height...")
611611
err := attempt()
612612

613-
switch {
614-
case err == nil:
615-
log.Info("RegisterBlockEpochNtfn returned a height. " +
616-
"Success!")
617-
618-
return nil
619-
620-
case errors.Is(err, errRetry):
613+
if errors.Is(err, errRetry) {
621614
log.Info("ChainNotifier is not ready yet. Will retry")
622615

623616
continue
624-
625-
default:
617+
} else if err != nil {
626618
log.Info("RegisterBlockEpochNtfn returned unexpected "+
627619
"error %v. LND client failed to start!", err)
628620

629621
return err
630622
}
623+
624+
log.Info("RegisterBlockEpochNtfn returned a height. Success!")
625+
break
631626
}
627+
628+
return nil
632629
}
633630

634631
// getLndInfo queries lnd for information about the node it is connected to.

0 commit comments

Comments
 (0)