aboutsummaryrefslogtreecommitdiffstats
path: root/core/rawdb
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-11-16 22:34:30 +0800
committerGitHub <noreply@github.com>2018-11-16 22:34:30 +0800
commit91c66d47effed704e3f5e6be8b44474b722c3c45 (patch)
tree33b8721bd8001e80b8250f4a783babf0b5110a68 /core/rawdb
parent68be45e5f89a5bde33376a8e103c133392f18516 (diff)
parentaccc0fab4f407eaeab428127bd5395a28f371f9f (diff)
downloaddexon-91c66d47effed704e3f5e6be8b44474b722c3c45.tar
dexon-91c66d47effed704e3f5e6be8b44474b722c3c45.tar.gz
dexon-91c66d47effed704e3f5e6be8b44474b722c3c45.tar.bz2
dexon-91c66d47effed704e3f5e6be8b44474b722c3c45.tar.lz
dexon-91c66d47effed704e3f5e6be8b44474b722c3c45.tar.xz
dexon-91c66d47effed704e3f5e6be8b44474b722c3c45.tar.zst
dexon-91c66d47effed704e3f5e6be8b44474b722c3c45.zip
Merge pull request #18085 from holiman/downloader_span
downloader: different sync strategy
Diffstat (limited to 'core/rawdb')
-rw-r--r--core/rawdb/accessors_chain.go9
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