Skip to content

Commit

Permalink
Avoid cfg lookup on chain remove since unenabled splitstore delete is…
Browse files Browse the repository at this point in the history
… noop anyway (#11916)

Co-authored-by: zenground0 <[email protected]>
  • Loading branch information
ZenGround0 and ZenGround0 authored Apr 23, 2024
1 parent 70e0767 commit 95b6483
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions cmd/lotus/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 95b6483

Please sign in to comment.