|
|
@ -208,7 +208,7 @@ func NewDatabaseWithFreezer(db ethdb.KeyValueStore, freezer string, namespace st |
|
|
|
// are contiguous, otherwise we might end up with a non-functional freezer.
|
|
|
|
// are contiguous, otherwise we might end up with a non-functional freezer.
|
|
|
|
if kvhash, _ := db.Get(headerHashKey(frozen)); len(kvhash) == 0 { |
|
|
|
if kvhash, _ := db.Get(headerHashKey(frozen)); len(kvhash) == 0 { |
|
|
|
// Subsequent header after the freezer limit is missing from the database.
|
|
|
|
// Subsequent header after the freezer limit is missing from the database.
|
|
|
|
// Reject startup is the database has a more recent head.
|
|
|
|
// Reject startup if the database has a more recent head.
|
|
|
|
if *ReadHeaderNumber(db, ReadHeadHeaderHash(db)) > frozen-1 { |
|
|
|
if *ReadHeaderNumber(db, ReadHeadHeaderHash(db)) > frozen-1 { |
|
|
|
return nil, fmt.Errorf("gap (#%d) in the chain between ancients and leveldb", frozen) |
|
|
|
return nil, fmt.Errorf("gap (#%d) in the chain between ancients and leveldb", frozen) |
|
|
|
} |
|
|
|
} |
|
|
|