mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
core: use buffered ch for subscription
This commit is contained in:
parent
1d006bd5bf
commit
150dd4db23
1 changed files with 1 additions and 1 deletions
|
|
@ -132,7 +132,7 @@ func (indexer *txIndexer) loop(chain *BlockChain) {
|
||||||
lastHead uint64 // The latest announced chain head (whose tx indexes are assumed created)
|
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
|
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)
|
sub = chain.SubscribeChainHeadEvent(headCh)
|
||||||
)
|
)
|
||||||
defer sub.Unsubscribe()
|
defer sub.Unsubscribe()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue