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() } }