core/rawdb: fix double-lock causing hang (#24189)
Fixes #24159 Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
parent
d0bd5017ed
commit
66a908c5e8
@ -447,8 +447,11 @@ func ReadCanonicalBodyRLP(db ethdb.Reader, number uint64) rlp.RawValue {
|
|||||||
if len(data) > 0 {
|
if len(data) > 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// Get it by hash from leveldb
|
// Block is not in ancients, read from leveldb by hash and number.
|
||||||
data, _ = db.Get(blockBodyKey(number, ReadCanonicalHash(db, number)))
|
// Note: ReadCanonicalHash cannot be used here because it also
|
||||||
|
// calls ReadAncients internally.
|
||||||
|
hash, _ := db.Get(headerHashKey(number))
|
||||||
|
data, _ = db.Get(blockBodyKey(number, common.BytesToHash(hash)))
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
return data
|
return data
|
||||||
|
Loading…
Reference in New Issue
Block a user