Trace filter 6 (#1921)

* Improvements to stage1 in download.v2

* Stop timer earlier

* Stop timer earlier

* Print apends

* Fix traceCursor

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
This commit is contained in:
ledgerwatch 2021-05-12 17:35:46 +01:00 committed by GitHub
parent 47d22773b9
commit ddcf271ca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -280,14 +280,21 @@ func SpawnExecuteBlocksStage(s *StageState, tx ethdb.RwTx, toBlock uint64, quit
if err = s.Update(tx, stageProgress); err != nil {
return err
}
if traceCursor != nil {
traceCursor.Close()
}
if err = tx.Commit(); err != nil {
return err
}
tx, err = cfg.db.BeginRw(context.Background())
if err != nil {
return err
}
if cfg.writeCallTraces {
if traceCursor, err = tx.RwCursorDupSort(dbutils.CallTraceSet); err != nil {
return fmt.Errorf("%s: failed to create cursor for call traces: %v", logPrefix, err)
}
}
}
batch = ethdb.NewBatch(tx)
}
@ -312,6 +319,9 @@ func SpawnExecuteBlocksStage(s *StageState, tx ethdb.RwTx, toBlock uint64, quit
}
}
if !useExternalTx {
if traceCursor != nil {
traceCursor.Close()
}
if err := tx.Commit(); err != nil {
return err
}