|
|
@ -880,7 +880,7 @@ func newTimestampCompatError(what string, storedtime, newtime *uint64) *ConfigCo |
|
|
|
NewTime: newtime, |
|
|
|
NewTime: newtime, |
|
|
|
RewindToTime: 0, |
|
|
|
RewindToTime: 0, |
|
|
|
} |
|
|
|
} |
|
|
|
if rew != nil { |
|
|
|
if rew != nil && *rew != 0 { |
|
|
|
err.RewindToTime = *rew - 1 |
|
|
|
err.RewindToTime = *rew - 1 |
|
|
|
} |
|
|
|
} |
|
|
|
return err |
|
|
|
return err |
|
|
@ -890,7 +890,15 @@ func (err *ConfigCompatError) Error() string { |
|
|
|
if err.StoredBlock != nil { |
|
|
|
if err.StoredBlock != nil { |
|
|
|
return fmt.Sprintf("mismatching %s in database (have block %d, want block %d, rewindto block %d)", err.What, err.StoredBlock, err.NewBlock, err.RewindToBlock) |
|
|
|
return fmt.Sprintf("mismatching %s in database (have block %d, want block %d, rewindto block %d)", err.What, err.StoredBlock, err.NewBlock, err.RewindToBlock) |
|
|
|
} |
|
|
|
} |
|
|
|
return fmt.Sprintf("mismatching %s in database (have timestamp %d, want timestamp %d, rewindto timestamp %d)", err.What, err.StoredTime, err.NewTime, err.RewindToTime) |
|
|
|
|
|
|
|
|
|
|
|
if err.StoredTime == nil && err.NewTime == nil { |
|
|
|
|
|
|
|
return "" |
|
|
|
|
|
|
|
} else if err.StoredTime == nil && err.NewTime != nil { |
|
|
|
|
|
|
|
return fmt.Sprintf("mismatching %s in database (have timestamp nil, want timestamp %d, rewindto timestamp %d)", err.What, *err.NewTime, err.RewindToTime) |
|
|
|
|
|
|
|
} else if err.StoredTime != nil && err.NewTime == nil { |
|
|
|
|
|
|
|
return fmt.Sprintf("mismatching %s in database (have timestamp %d, want timestamp nil, rewindto timestamp %d)", err.What, *err.StoredTime, err.RewindToTime) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return fmt.Sprintf("mismatching %s in database (have timestamp %d, want timestamp %d, rewindto timestamp %d)", err.What, *err.StoredTime, *err.NewTime, err.RewindToTime) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Rules wraps ChainConfig and is merely syntactic sugar or can be used for functions
|
|
|
|
// Rules wraps ChainConfig and is merely syntactic sugar or can be used for functions
|
|
|
|