Skip to content

Commit f77dd5f

Browse files
committed
update
1 parent da210ce commit f77dd5f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

core/rawdb/accessors_chain.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,19 @@ import (
3535
func ReadCanonicalHash(db ethdb.Reader, number uint64) common.Hash {
3636
data, _ := db.Ancient(freezerHashTable, number)
3737
if len(data) == 0 {
38+
log.Error("Ancient(freezerHashTable empty", "number", number)
3839
data, _ = db.Get(headerHashKey(number))
3940
// In the background freezer is moving data from leveldb to flatten files.
4041
// So during the first check for ancient db, the data is not yet in there,
4142
// but when we reach into leveldb, the data was already moved. That would
4243
// result in a not found error.
4344
if len(data) == 0 {
45+
log.Error("Get(headerHashKey empty", "number", number)
4446
data, _ = db.Ancient(freezerHashTable, number)
4547
}
4648
}
4749
if len(data) == 0 {
50+
log.Error("Ancient(freezerHashTable empty again", "number", number)
4851
return common.Hash{}
4952
}
5053
return common.BytesToHash(data)

core/rawdb/accessors_indexes.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333
func ReadTxLookupEntry(db ethdb.Reader, hash common.Hash) *uint64 {
3434
data, _ := db.Get(txLookupKey(hash))
3535
if len(data) == 0 {
36+
log.Error("txLookupKey get failed", "hash", hash)
3637
return nil
3738
}
3839
// Database v6 tx lookup just stores the block number
@@ -98,10 +99,12 @@ func DeleteTxLookupEntries(db ethdb.KeyValueWriter, hashes []common.Hash) {
9899
func ReadTransaction(db ethdb.Reader, hash common.Hash) (*types.Transaction, common.Hash, uint64, uint64) {
99100
blockNumber := ReadTxLookupEntry(db, hash)
100101
if blockNumber == nil {
102+
log.Error("ReadTxLookupEntry failed", "hash", hash)
101103
return nil, common.Hash{}, 0, 0
102104
}
103105
blockHash := ReadCanonicalHash(db, *blockNumber)
104106
if blockHash == (common.Hash{}) {
107+
log.Error("ReadCanonicalHash failed", "number", blockNumber, "hash", hash)
105108
return nil, common.Hash{}, 0, 0
106109
}
107110
body := ReadBody(db, blockHash, *blockNumber)

0 commit comments

Comments
 (0)