From 0fcdd9fefd28fd25b01f242ec1907cf75b960d1b Mon Sep 17 00:00:00 2001 From: Linden <70739041+linden@users.noreply.github.com> Date: Wed, 9 Oct 2024 11:54:11 -0700 Subject: [PATCH] fix(`btcdctrl`): handle timeout cases separately the client could exist but with an error case, this should be handled. --- btcdctrl/btcdctrl.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/btcdctrl/btcdctrl.go b/btcdctrl/btcdctrl.go index fa4345ee4e..77b4fb6ccf 100644 --- a/btcdctrl/btcdctrl.go +++ b/btcdctrl/btcdctrl.go @@ -354,13 +354,13 @@ func (c *Controller) Start() error { break } + // Check if the connection loop exited with an error. + if err != nil { + return errors.Join(errors.New("timeout"), err) + } + // Check if the client was created. if c.Client == nil { - // Check if the connection loop exited with an error. - if err != nil { - return errors.Join(errors.New("timeout"), err) - } - return errors.New("timeout") }