save progresss (#1283)

This commit is contained in:
Alex Sharov 2020-10-23 17:52:18 +07:00 committed by GitHub
parent bf044f73ef
commit dd5258d524
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -107,6 +107,7 @@ func syncBySmallSteps(ctx context.Context, chaindata string) error {
}
st.DisableStages(stages.Headers, stages.BlockHashes, stages.Bodies, stages.Senders)
_ = st.SetCurrentStage(stages.Execution)
senderStageProgress := progress(stages.Senders).BlockNumber

View File

@ -152,6 +152,9 @@ func (s *State) Run(db ethdb.GetterPutter, tx ethdb.GetterPutter) error {
for !s.IsDone() {
if !s.unwindStack.Empty() {
for unwind := s.unwindStack.Pop(); unwind != nil; unwind = s.unwindStack.Pop() {
if err := s.SetCurrentStage(unwind.Stage); err != nil {
return err
}
if s.onBeforeUnwind != nil {
if err := s.onBeforeUnwind(unwind.Stage); err != nil {
return err