From 0a14a72eab7343be0bc6bd675aaf983b5426a369 Mon Sep 17 00:00:00 2001 From: jsvisa Date: Tue, 12 Aug 2025 15:03:10 +0800 Subject: [PATCH] stop state size inside stop without saving Signed-off-by: jsvisa --- core/blockchain.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 790ec1f152..963e7bcec5 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1259,6 +1259,12 @@ func (bc *BlockChain) stopWithoutSaving() { // Signal shutdown to all goroutines. bc.InterruptInsert(true) + // Stop state size generator if running + if bc.stateSizeGen != nil { + bc.stateSizeGen.Stop() + log.Info("Stopped state size generator") + } + // Now wait for all chain modifications to end and persistent goroutines to exit. // // Note: Close waits for the mutex to become available, i.e. any running chain @@ -1320,11 +1326,6 @@ func (bc *BlockChain) Stop() { } } } - // Stop state size generator if running - if bc.stateSizeGen != nil { - bc.stateSizeGen.Stop() - log.Info("Stopped state size generator") - } // Allow tracers to clean-up and release resources. if bc.logger != nil && bc.logger.OnClose != nil {