Skip to content

Commit c57fdd7

Browse files
committed
fix comments
1 parent 7ad4d02 commit c57fdd7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/blockchain.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ type BlockChain struct {
227227
// trusted diff layers
228228
diffLayerCache *lru.Cache // Cache for the diffLayers
229229
diffLayerRLPCache *lru.Cache // Cache for the rlp encoded diffLayers
230-
diffLayerChanCache *lru.Cache // Cache for
230+
diffLayerChanCache *lru.Cache // Cache for the difflayer channel
231231
diffQueue *prque.Prque // A Priority queue to store recent diff layer
232232
diffQueueBuffer chan *types.DiffLayer
233233
diffLayerFreezerBlockLimit uint64
@@ -1834,6 +1834,9 @@ func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types.
18341834
diffLayer.Number = block.NumberU64()
18351835

18361836
diffLayerCh := make(chan struct{})
1837+
if bc.diffLayerChanCache.Len() >= diffLayerCacheLimit {
1838+
bc.diffLayerChanCache.RemoveOldest()
1839+
}
18371840
bc.diffLayerChanCache.Add(diffLayer.BlockHash, diffLayerCh)
18381841

18391842
go bc.cacheDiffLayer(diffLayer, false)

0 commit comments

Comments
 (0)