From 150dd4db23f4e4f1519d1ff168b2258be9bbcb2e Mon Sep 17 00:00:00 2001 From: Ceyhun Onur Date: Sat, 24 Aug 2024 17:36:31 +0300 Subject: [PATCH] core: use buffered ch for subscription --- core/txindexer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/txindexer.go b/core/txindexer.go index 70fe5f33220f..b3fc3d4d54d7 100644 --- a/core/txindexer.go +++ b/core/txindexer.go @@ -132,7 +132,7 @@ func (indexer *txIndexer) loop(chain *BlockChain) { lastHead uint64 // The latest announced chain head (whose tx indexes are assumed created) lastTail = rawdb.ReadTxIndexTail(indexer.db) // The oldest indexed block, nil means nothing indexed - headCh = make(chan ChainHeadEvent) + headCh = make(chan ChainHeadEvent, 5) sub = chain.SubscribeChainHeadEvent(headCh) ) defer sub.Unsubscribe()