aboutsummaryrefslogtreecommitdiffstats
path: root/eth/db_upgrade.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-09-06 18:00:35 +0800
committerGitHub <noreply@github.com>2017-09-06 18:00:35 +0800
commitc4d21bc8e548d909d5b2940cb00d3d068f5697ec (patch)
tree1747315b32a6c9d9158fb9f36cfbd2277672ddfb /eth/db_upgrade.go
parent160add8570ea1653b46cc1f7c21cb6eb69220f7d (diff)
parent564c8f3ae6f80d039ef27479e5ad15145f488710 (diff)
downloaddexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.tar
dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.tar.gz
dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.tar.bz2
dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.tar.lz
dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.tar.xz
dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.tar.zst
dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.zip
Merge pull request #14631 from zsfelfoldi/bloombits2
core/bloombits, eth/filter: transformed bloom bitmap based log search
Diffstat (limited to 'eth/db_upgrade.go')
-rw-r--r--eth/db_upgrade.go44
1 files changed, 0 insertions, 44 deletions
diff --git a/eth/db_upgrade.go b/eth/db_upgrade.go
index 90111b2b3..d41afa17c 100644
--- a/eth/db_upgrade.go
+++ b/eth/db_upgrade.go
@@ -19,7 +19,6 @@ package eth
import (
"bytes"
- "fmt"
"time"
"github.com/ethereum/go-ethereum/common"
@@ -134,46 +133,3 @@ func upgradeDeduplicateData(db ethdb.Database) func() error {
return <-errc
}
}
-
-func addMipmapBloomBins(db ethdb.Database) (err error) {
- const mipmapVersion uint = 2
-
- // check if the version is set. We ignore data for now since there's
- // only one version so we can easily ignore it for now
- var data []byte
- data, _ = db.Get([]byte("setting-mipmap-version"))
- if len(data) > 0 {
- var version uint
- if err := rlp.DecodeBytes(data, &version); err == nil && version == mipmapVersion {
- return nil
- }
- }
-
- defer func() {
- if err == nil {
- var val []byte
- val, err = rlp.EncodeToBytes(mipmapVersion)
- if err == nil {
- err = db.Put([]byte("setting-mipmap-version"), val)
- }
- return
- }
- }()
- latestHash := core.GetHeadBlockHash(db)
- latestBlock := core.GetBlock(db, latestHash, core.GetBlockNumber(db, latestHash))
- if latestBlock == nil { // clean database
- return
- }
-
- tstart := time.Now()
- log.Warn("Upgrading db log bloom bins")
- for i := uint64(0); i <= latestBlock.NumberU64(); i++ {
- hash := core.GetCanonicalHash(db, i)
- if (hash == common.Hash{}) {
- return fmt.Errorf("chain db corrupted. Could not find block %d.", i)
- }
- core.WriteMipmapBloom(db, i, core.GetBlockReceipts(db, hash, i))
- }
- log.Info("Bloom-bin upgrade completed", "elapsed", common.PrettyDuration(time.Since(tstart)))
- return nil
-}