From 42c34947eabe9734131952decda2284354597b59 Mon Sep 17 00:00:00 2001 From: benbaley Date: Wed, 28 Feb 2024 17:33:22 +0800 Subject: [PATCH] =?UTF-8?q?1.5.0=E7=89=88=E6=9C=ACenableGC=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E5=88=A0=E9=99=A4=E5=9B=9E=E6=89=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/blockchain.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 6fd480be5c..a70c64c58f 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -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 @@ -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 { @@ -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. // @@ -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)