Skip to content

Commit 28d076d

Browse files
authored
core/rawdb: provide more info on 'gap in the chain' error (#25938)
1 parent 1c737e8 commit 28d076d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/rawdb/database.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ func NewDatabaseWithFreezer(db ethdb.KeyValueStore, ancient string, namespace st
240240
if kvhash, _ := db.Get(headerHashKey(frozen)); len(kvhash) == 0 {
241241
// Subsequent header after the freezer limit is missing from the database.
242242
// Reject startup if the database has a more recent head.
243-
if *ReadHeaderNumber(db, ReadHeadHeaderHash(db)) > frozen-1 {
244-
return nil, fmt.Errorf("gap (#%d) in the chain between ancients and leveldb", frozen)
243+
if ldbNum := *ReadHeaderNumber(db, ReadHeadHeaderHash(db)); ldbNum > frozen-1 {
244+
return nil, fmt.Errorf("gap in the chain between ancients (#%d) and leveldb (#%d) ", frozen, ldbNum)
245245
}
246246
// Database contains only older data than the freezer, this happens if the
247247
// state was wiped and reinited from an existing freezer.

0 commit comments

Comments
 (0)