mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
Revert "core/rawdb: check pruning tail in HasBody and HasReceipts (#33747)"
This reverts commit e64c8d8e26.
This commit is contained in:
parent
01fe1d716c
commit
d5baee7fad
1 changed files with 2 additions and 14 deletions
|
|
@ -424,13 +424,7 @@ func WriteBodyRLP(db ethdb.KeyValueWriter, hash common.Hash, number uint64, rlp
|
|||
// HasBody verifies the existence of a block body corresponding to the hash.
|
||||
func HasBody(db ethdb.Reader, hash common.Hash, number uint64) bool {
|
||||
if isCanon(db, number, hash) {
|
||||
// Block is in ancient store, but bodies can be pruned.
|
||||
// Check if the block number is above the pruning tail.
|
||||
tail, _ := db.Tail()
|
||||
if number >= tail {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
return true
|
||||
}
|
||||
if has, err := db.Has(blockBodyKey(number, hash)); !has || err != nil {
|
||||
return false
|
||||
|
|
@ -472,13 +466,7 @@ func DeleteBody(db ethdb.KeyValueWriter, hash common.Hash, number uint64) {
|
|||
// to a block.
|
||||
func HasReceipts(db ethdb.Reader, hash common.Hash, number uint64) bool {
|
||||
if isCanon(db, number, hash) {
|
||||
// Block is in ancient store, but receipts can be pruned.
|
||||
// Check if the block number is above the pruning tail.
|
||||
tail, _ := db.Tail()
|
||||
if number >= tail {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
return true
|
||||
}
|
||||
if has, err := db.Has(blockReceiptsKey(number, hash)); !has || err != nil {
|
||||
return false
|
||||
|
|
|
|||
Loading…
Reference in a new issue