aboutsummaryrefslogtreecommitdiffstats
path: root/core/rawdb/schema.go
diff options
context:
space:
mode:
authorSonic <sonic@dexon.org>2018-11-20 12:05:00 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:53 +0800
commite73d666ae31efc896f9b359a8262e97a7fd36b78 (patch)
tree7e33b900a126ef4622b262d10f9ca0a2ff939a58 /core/rawdb/schema.go
parent91c679269a435b91396cfd12ff95c86dabe8efd5 (diff)
downloaddexon-e73d666ae31efc896f9b359a8262e97a7fd36b78.tar
dexon-e73d666ae31efc896f9b359a8262e97a7fd36b78.tar.gz
dexon-e73d666ae31efc896f9b359a8262e97a7fd36b78.tar.bz2
dexon-e73d666ae31efc896f9b359a8262e97a7fd36b78.tar.lz
dexon-e73d666ae31efc896f9b359a8262e97a7fd36b78.tar.xz
dexon-e73d666ae31efc896f9b359a8262e97a7fd36b78.tar.zst
dexon-e73d666ae31efc896f9b359a8262e97a7fd36b78.zip
dex: add BlockDB, which implements consensus core's blockdb.BlockDatabase (#36)
Diffstat (limited to 'core/rawdb/schema.go')
-rw-r--r--core/rawdb/schema.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/rawdb/schema.go b/core/rawdb/schema.go
index ee1949112..9a820a578 100644
--- a/core/rawdb/schema.go
+++ b/core/rawdb/schema.go
@@ -53,6 +53,8 @@ var (
txLookupPrefix = []byte("l") // txLookupPrefix + hash -> transaction/receipt lookup metadata
bloomBitsPrefix = []byte("B") // bloomBitsPrefix + bit (uint16 big endian) + section (uint64 big endian) + hash -> bloom bits
+ coreBlockPrefix = []byte("D")
+
preimagePrefix = []byte("secure-key-") // preimagePrefix + hash -> preimage
configPrefix = []byte("ethereum-config-") // config prefix for the db
@@ -113,6 +115,11 @@ func txLookupKey(hash common.Hash) []byte {
return append(txLookupPrefix, hash.Bytes()...)
}
+// coreBlockKey = coreBlockPrefix + hash
+func coreBlockKey(hash common.Hash) []byte {
+ return append(coreBlockPrefix, hash.Bytes()...)
+}
+
// bloomBitsKey = bloomBitsPrefix + bit (uint16 big endian) + section (uint64 big endian) + hash
func bloomBitsKey(bit uint, section uint64, hash common.Hash) []byte {
key := append(append(bloomBitsPrefix, make([]byte, 10)...), hash.Bytes()...)