From 8e168a69d9ecddb0a951d6f32935a702317ad757 Mon Sep 17 00:00:00 2001 From: Sergio Mena Date: Wed, 12 Oct 2022 16:40:51 +0200 Subject: [PATCH] this is my c-style fix --- blocksync/pool.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/blocksync/pool.go b/blocksync/pool.go index 57ba94ce8..9752a6d2e 100644 --- a/blocksync/pool.go +++ b/blocksync/pool.go @@ -623,8 +623,10 @@ OUTER_LOOP: if err := bpr.Stop(); err != nil { bpr.Logger.Error("Error stopped requester", "err", err) } + to.Stop() return case <-bpr.Quit(): + to.Stop() return case <-to.C: bpr.Logger.Debug("Retrying block request after timeout", "height", bpr.height, "peer", bpr.peerID) @@ -633,6 +635,7 @@ OUTER_LOOP: continue OUTER_LOOP case peerID := <-bpr.redoCh: if peerID == bpr.peerID { + to.Stop() bpr.reset() continue OUTER_LOOP } else { @@ -641,6 +644,7 @@ OUTER_LOOP: case <-bpr.gotBlockCh: // We got a block! // Continue the for-loop and wait til Quit. + to.Stop() continue WAIT_LOOP } }