core/rawdb: refactor db key prefix (#26000)

Co-authored-by: seven <seven@nodereal.io>
This commit is contained in:
s7v7nislands
2022-10-19 09:53:09 +02:00
committed by GitHub
co-authored by seven
parent 6069d8294e
commit d86fe26f67
6 changed files with 34 additions and 30 deletions
+2 -2
View File
@@ -383,10 +383,10 @@ func (h *serverHandler) GetHelperTrie(typ uint, index uint64) *trie.Trie {
switch typ {
case htCanonical:
sectionHead := rawdb.ReadCanonicalHash(h.chainDb, (index+1)*h.server.iConfig.ChtSize-1)
root, prefix = light.GetChtRoot(h.chainDb, index, sectionHead), light.ChtTablePrefix
root, prefix = light.GetChtRoot(h.chainDb, index, sectionHead), string(rawdb.ChtTablePrefix)
case htBloomBits:
sectionHead := rawdb.ReadCanonicalHash(h.chainDb, (index+1)*h.server.iConfig.BloomTrieSize-1)
root, prefix = light.GetBloomTrieRoot(h.chainDb, index, sectionHead), light.BloomTrieTablePrefix
root, prefix = light.GetBloomTrieRoot(h.chainDb, index, sectionHead), string(rawdb.BloomTrieTablePrefix)
}
if root == (common.Hash{}) {
return nil