diff --git a/pkg/core/stateroot/module.go b/pkg/core/stateroot/module.go index 61b1d54db..a20198744 100644 --- a/pkg/core/stateroot/module.go +++ b/pkg/core/stateroot/module.go @@ -203,8 +203,9 @@ func (s *Module) Init(height uint32) error { // outdated MPT data before state sync process can be started. // Note: this method is aimed to be called for genesis block only, an error is returned otherwise. func (s *Module) CleanStorage() error { - if s.localHeight.Load() != 0 { - return fmt.Errorf("can't clean MPT data for non-genesis block: expected local stateroot height 0, got %d", s.localHeight.Load()) + lH := s.localHeight.Load() + if lH != 0 { + return fmt.Errorf("can't clean MPT data for non-genesis block: expected local stateroot height 0, got %d", lH) } b := storage.NewMemCachedStore(s.Store) s.Store.Seek(storage.SeekRange{Prefix: []byte{byte(storage.DataMPT)}}, func(k, _ []byte) bool {