From 0cae00b09c7edcba632188fa404eb25fba67ce01 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Thu, 1 May 2025 17:16:23 +0200 Subject: [PATCH] another ctx done case --- core/txindexer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/txindexer.go b/core/txindexer.go index 6c5361f519..9469ed04de 100644 --- a/core/txindexer.go +++ b/core/txindexer.go @@ -312,10 +312,14 @@ func (indexer *txIndexer) txIndexProgress(ctx context.Context) (TxIndexProgress, case prog := <-ch: return prog, nil case <-ctx.Done(): + // Since the channel is buffered the loop will not block + // eventually when it prepares the response. return TxIndexProgress{}, ctx.Err() } case <-indexer.closed: return TxIndexProgress{}, errors.New("indexer is closed") + case <-ctx.Done(): + return TxIndexProgress{}, ctx.Err() } }