Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 committed Apr 20, 2022
1 parent 7ad4d02 commit c57fdd7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ type BlockChain struct {
// trusted diff layers
diffLayerCache *lru.Cache // Cache for the diffLayers
diffLayerRLPCache *lru.Cache // Cache for the rlp encoded diffLayers
diffLayerChanCache *lru.Cache // Cache for
diffLayerChanCache *lru.Cache // Cache for the difflayer channel
diffQueue *prque.Prque // A Priority queue to store recent diff layer
diffQueueBuffer chan *types.DiffLayer
diffLayerFreezerBlockLimit uint64
Expand Down Expand Up @@ -1834,6 +1834,9 @@ func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types.
diffLayer.Number = block.NumberU64()

diffLayerCh := make(chan struct{})
if bc.diffLayerChanCache.Len() >= diffLayerCacheLimit {
bc.diffLayerChanCache.RemoveOldest()
}
bc.diffLayerChanCache.Add(diffLayer.BlockHash, diffLayerCh)

go bc.cacheDiffLayer(diffLayer, false)
Expand Down

0 comments on commit c57fdd7

Please sign in to comment.