good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 6c0ff333 authored by Alex Sharov's avatar Alex Sharov Committed by GitHub
Browse files

integration: clear unwind stack (#890)

parent 05789499
No related branches found
No related tags found
No related merge requests found
...@@ -40,11 +40,42 @@ var cmdResetState = &cobra.Command{ ...@@ -40,11 +40,42 @@ var cmdResetState = &cobra.Command{
}, },
} }
var cmdClearUnwindStack = &cobra.Command{
Use: "clear_unwind_stack",
Short: "Clear unwind stack",
RunE: func(cmd *cobra.Command, args []string) error {
ctx := rootContext()
err := clearUnwindStack(ctx)
if err != nil {
log.Error(err.Error())
return err
}
return nil
},
}
func init() { func init() {
withChaindata(cmdResetState) withChaindata(cmdResetState)
withCompact(cmdResetState) withCompact(cmdResetState)
rootCmd.AddCommand(cmdResetState) rootCmd.AddCommand(cmdResetState)
withChaindata(cmdClearUnwindStack)
rootCmd.AddCommand(cmdClearUnwindStack)
}
func clearUnwindStack(_ context.Context) error {
db := ethdb.MustOpen(chaindata)
defer db.Close()
for i := stages.SyncStage(0); i < stages.Finish; i++ {
if err := stages.SaveStageUnwind(db, i, 0, nil); err != nil {
return err
}
}
return nil
} }
func resetState(_ context.Context) error { func resetState(_ context.Context) error {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment