mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-18 08:38:46 +00:00
Fix migration for clean database (#2097)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
This commit is contained in:
parent
7cd8046c35
commit
5a54eab268
@ -19,7 +19,7 @@ var rebuilCallTraceIndex = Migration{
|
|||||||
}
|
}
|
||||||
if !sm.CallTraces {
|
if !sm.CallTraces {
|
||||||
// Call traces are not on, nothing to migrate
|
// Call traces are not on, nothing to migrate
|
||||||
return nil
|
return CommitProgress(db, nil, true)
|
||||||
}
|
}
|
||||||
// Find the lowest key in the TraceCallSet table
|
// Find the lowest key in the TraceCallSet table
|
||||||
tx := db.(ethdb.HasTx).Tx()
|
tx := db.(ethdb.HasTx).Tx()
|
||||||
@ -35,12 +35,12 @@ var rebuilCallTraceIndex = Migration{
|
|||||||
}
|
}
|
||||||
if k == nil {
|
if k == nil {
|
||||||
log.Warn("Nothing to rebuild, CallTraceSet table is empty")
|
log.Warn("Nothing to rebuild, CallTraceSet table is empty")
|
||||||
return nil
|
return CommitProgress(db, nil, true)
|
||||||
}
|
}
|
||||||
blockNum := binary.BigEndian.Uint64((k))
|
blockNum := binary.BigEndian.Uint64((k))
|
||||||
if blockNum == 0 {
|
if blockNum == 0 {
|
||||||
log.Warn("Nothing to rebuild, CallTraceSet's first record", "number", blockNum)
|
log.Warn("Nothing to rebuild, CallTraceSet's first record", "number", blockNum)
|
||||||
return nil
|
return CommitProgress(db, nil, true)
|
||||||
}
|
}
|
||||||
log.Info("First record in CallTraceTable", "number", blockNum)
|
log.Info("First record in CallTraceTable", "number", blockNum)
|
||||||
if err = stages.SaveStageUnwind(db, stages.CallTraces, blockNum-1); err != nil {
|
if err = stages.SaveStageUnwind(db, stages.CallTraces, blockNum-1); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user