From bd3e2600fdfebdbdfc1762e63d90641c3b931693 Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Mon, 18 Dec 2023 10:49:40 +0800 Subject: [PATCH] eth/downloader: make Broadcast run after Wait (#264) --- eth/downloader/queue.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index fca2e54875..2a093f075b 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -146,6 +146,9 @@ func (q *queue) Reset() { // Close marks the end of the sync, unblocking WaitResults. // It may be called even if the queue is already closed. func (q *queue) Close() { + q.lock.Lock() + defer q.lock.Unlock() + q.closed = true q.active.Broadcast() }