mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
core: back-up to kvdb for a pruned block
This commit is contained in:
parent
21b035eb29
commit
92c0695cf3
1 changed files with 6 additions and 0 deletions
|
|
@ -440,6 +440,12 @@ func ReadBodyRLP(db ethdb.Reader, hash common.Hash, number uint64) rlp.RawValue
|
||||||
// Check if the data is in ancients
|
// Check if the data is in ancients
|
||||||
if isCanon(reader, number, hash) {
|
if isCanon(reader, number, hash) {
|
||||||
data, _ = reader.Ancient(ChainFreezerBodiesTable, number)
|
data, _ = reader.Ancient(ChainFreezerBodiesTable, number)
|
||||||
|
// The freezer might be pruned. In the particular case of genesis, the block
|
||||||
|
// will be still available in kvdb. The full genesis block is needed on startup
|
||||||
|
// sometimes for repair.
|
||||||
|
if data == nil {
|
||||||
|
data, _ = db.Get(blockBodyKey(number, hash))
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// If not, try reading from leveldb
|
// If not, try reading from leveldb
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue