From cfd0ad9c859c537c86afa33aad6cd30232d0b968 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 d7acc172b9f..3c9244779c3 100644 --- a/btcdctrl/btcdctrl.go +++ b/btcdctrl/btcdctrl.go @@ -356,13 +356,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") }