diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-11-16 19:15:05 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-11-16 19:21:20 +0800 |
commit | accc0fab4f407eaeab428127bd5395a28f371f9f (patch) | |
tree | 33b8721bd8001e80b8250f4a783babf0b5110a68 /core/rawdb | |
parent | 51b2f1620cc22aa410dee24a6021bb767e0ff998 (diff) | |
download | dexon-accc0fab4f407eaeab428127bd5395a28f371f9f.tar dexon-accc0fab4f407eaeab428127bd5395a28f371f9f.tar.gz dexon-accc0fab4f407eaeab428127bd5395a28f371f9f.tar.bz2 dexon-accc0fab4f407eaeab428127bd5395a28f371f9f.tar.lz dexon-accc0fab4f407eaeab428127bd5395a28f371f9f.tar.xz dexon-accc0fab4f407eaeab428127bd5395a28f371f9f.tar.zst dexon-accc0fab4f407eaeab428127bd5395a28f371f9f.zip |
core, eth/downloader: fix ancestor lookup for fast sync
Diffstat (limited to 'core/rawdb')
-rw-r--r-- | core/rawdb/accessors_chain.go | 9 |
1 files changed, 9 insertions, 0 deletions
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 |