Skip to content

Commit

Permalink
1.5.0版本enableGC时不再删除回执
Browse files Browse the repository at this point in the history
  • Loading branch information
benbaley committed Feb 28, 2024
1 parent f82509e commit 42c3494
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ type BlockChain struct {

shouldPreserve func(*types.Block) bool // Function used to determine whether should preserve the given block.

cleaner *Cleaner
//cleaner *Cleaner
}

// NewBlockChain returns a fully initialised block chain using information
Expand Down Expand Up @@ -393,7 +393,7 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *par
}

log.Debug("DB config", "DBDisabledGC", bc.cacheConfig.DBDisabledGC, "DBGCInterval", bc.cacheConfig.DBGCInterval, "DBGCTimeout", bc.cacheConfig.DBGCTimeout, "DBGCMpt", bc.cacheConfig.DBGCMpt)
bc.cleaner = NewCleaner(bc, bc.cacheConfig.DBGCInterval, bc.cacheConfig.DBGCTimeout, bc.cacheConfig.DBGCMpt)
//bc.cleaner = NewCleaner(bc, bc.cacheConfig.DBGCInterval, bc.cacheConfig.DBGCTimeout, bc.cacheConfig.DBGCMpt)

// Load any existing snapshot, regenerating it if loading failed
if bc.cacheConfig.SnapshotLimit > 0 {
Expand Down Expand Up @@ -870,7 +870,7 @@ func (bc *BlockChain) Stop() {
close(bc.quit)
bc.StopInsert()

bc.cleaner.Stop()
//bc.cleaner.Stop()

// Now wait for all chain modifications to end and persistent goroutines to exit.
//
Expand Down Expand Up @@ -1462,9 +1462,9 @@ func (bc *BlockChain) writeBlockWithState(block *types.Block, receipts []*types.

bc.hc.SetCurrentHeader(block.Header())
// Cleanup storage
if !bc.cacheConfig.DBDisabledGC.IsSet() && bc.cleaner.NeedCleanup() {
bc.cleaner.Cleanup()
}
//if !bc.cacheConfig.DBDisabledGC.IsSet() && bc.cleaner.NeedCleanup() {
// bc.cleaner.Cleanup()
//}

bc.BlockFeed.Send(block)

Expand Down

0 comments on commit 42c3494

Please sign in to comment.