core: use buffered ch for subscription

This commit is contained in:
Ceyhun Onur 2024-08-24 17:36:31 +03:00
parent 1d006bd5bf
commit 150dd4db23
No known key found for this signature in database
GPG key ID: 60D53BEEE37F6422

View file

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