From accc0fab4f407eaeab428127bd5395a28f371f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Fri, 16 Nov 2018 13:15:05 +0200 Subject: core, eth/downloader: fix ancestor lookup for fast sync --- core/rawdb/accessors_chain.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'core/rawdb') diff --git a/core/rawdb/accessors_chain.go b/core/rawdb/accessors_chain.go index 6660e17de..491a125c6 100644 --- a/core/rawdb/accessors_chain.go +++ b/core/rawdb/accessors_chain.go @@ -271,6 +271,15 @@ func DeleteTd(db DatabaseDeleter, hash common.Hash, number uint64) { } } +// HasReceipts verifies the existence of all the transaction receipts belonging +// to a block. +func HasReceipts(db DatabaseReader, hash common.Hash, number uint64) bool { + if has, err := db.Has(blockReceiptsKey(number, hash)); !has || err != nil { + return false + } + return true +} + // ReadReceipts retrieves all the transaction receipts belonging to a block. func ReadReceipts(db DatabaseReader, hash common.Hash, number uint64) types.Receipts { // Retrieve the flattened receipt slice -- cgit v1.2.3