From 5f2d2a2369028a5a0ad28880c870b8c722bb56ad Mon Sep 17 00:00:00 2001 From: zenground0 Date: Mon, 22 Apr 2024 16:45:40 -0600 Subject: [PATCH] Avoid cfg lookup on chain remove since unenabled splitstore delete is noop anyway --- cmd/lotus/daemon.go | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/cmd/lotus/daemon.go b/cmd/lotus/daemon.go index aeb70343264..369938020f5 100644 --- a/cmd/lotus/daemon.go +++ b/cmd/lotus/daemon.go @@ -661,22 +661,10 @@ func removeExistingChain(cctx *cli.Context, lr repo.Repo) error { } }() - cfg, err := lockedRepo.Config() + log.Info("removing splitstore directory...") + err = deleteSplitstoreDir(lockedRepo) if err != nil { - return xerrors.Errorf("error getting config: %w", err) - } - - fullNodeConfig, ok := cfg.(*config.FullNode) - if !ok { - return xerrors.Errorf("wrong config type: %T", cfg) - } - - if fullNodeConfig.Chainstore.EnableSplitstore { - log.Info("removing splitstore directory...") - err = deleteSplitstoreDir(lockedRepo) - if err != nil { - return xerrors.Errorf("error removing splitstore directory: %w", err) - } + return xerrors.Errorf("error removing splitstore directory: %w", err) } // Get the base repo path