Skip to content

Commit fc47bc5

Browse files
committed
revert check pruning tail in HasBody and HasReceipts
1 parent bc401f4 commit fc47bc5

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

core/rawdb/accessors_chain.go

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -513,13 +513,7 @@ func WriteBodyRLP(db ctxcdb.KeyValueWriter, hash common.Hash, number uint64, rlp
513513
// HasBody verifies the existence of a block body corresponding to the hash.
514514
func HasBody(db ctxcdb.Reader, hash common.Hash, number uint64) bool {
515515
if isCanon(db, number, hash) {
516-
// Block is in ancient store, but bodies can be pruned.
517-
// Check if the block number is above the pruning tail.
518-
tail, _ := db.Tail()
519-
if number >= tail {
520-
return true
521-
}
522-
return false
516+
return true
523517
}
524518
if has, err := db.Has(blockBodyKey(number, hash)); !has || err != nil {
525519
return false
@@ -609,13 +603,7 @@ func DeleteTd(db ctxcdb.KeyValueWriter, hash common.Hash, number uint64) {
609603
// to a block.
610604
func HasReceipts(db ctxcdb.Reader, hash common.Hash, number uint64) bool {
611605
if isCanon(db, number, hash) {
612-
// Block is in ancient store, but receipts can be pruned.
613-
// Check if the block number is above the pruning tail.
614-
tail, _ := db.Tail()
615-
if number >= tail {
616-
return true
617-
}
618-
return false
606+
return true
619607
}
620608
if has, err := db.Has(blockReceiptsKey(number, hash)); !has || err != nil {
621609
return false

0 commit comments

Comments
 (0)