diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-02-24 19:59:56 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-24 19:59:56 +0800 |
commit | 50ee279f2585e9e2eee30f0e1d4a3bf5f781bd72 (patch) | |
tree | d7c6c0d60d51f54910f905094794a97da11a156d /cmd/geth | |
parent | 562ccff8229678a988533d725e6f3c608729b4f9 (diff) | |
parent | aca066f3378514bf99c56ff9723e9e7e86452326 (diff) | |
download | dexon-50ee279f2585e9e2eee30f0e1d4a3bf5f781bd72.tar dexon-50ee279f2585e9e2eee30f0e1d4a3bf5f781bd72.tar.gz dexon-50ee279f2585e9e2eee30f0e1d4a3bf5f781bd72.tar.bz2 dexon-50ee279f2585e9e2eee30f0e1d4a3bf5f781bd72.tar.lz dexon-50ee279f2585e9e2eee30f0e1d4a3bf5f781bd72.tar.xz dexon-50ee279f2585e9e2eee30f0e1d4a3bf5f781bd72.tar.zst dexon-50ee279f2585e9e2eee30f0e1d4a3bf5f781bd72.zip |
Merge pull request #3705 from karalabe/drop-legacy-commands
Drop legacy commands
Diffstat (limited to 'cmd/geth')
-rw-r--r-- | cmd/geth/chaincmd.go | 60 | ||||
-rw-r--r-- | cmd/geth/main.go | 1 |
2 files changed, 0 insertions, 61 deletions
diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 74950697c..1c21c4ded 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -19,7 +19,6 @@ package main import ( "fmt" "os" - "path/filepath" "runtime" "strconv" "sync/atomic" @@ -74,16 +73,6 @@ last block to write. In this mode, the file will be appended if already existing. `, } - upgradedbCommand = cli.Command{ - Action: upgradeDB, - Name: "upgradedb", - Usage: "Upgrade chainblock database", - ArgsUsage: " ", - Category: "BLOCKCHAIN COMMANDS", - Description: ` -TODO: Please write this -`, - } removedbCommand = cli.Command{ Action: removeDB, Name: "removedb", @@ -255,49 +244,6 @@ func removeDB(ctx *cli.Context) error { return nil } -func upgradeDB(ctx *cli.Context) error { - log.Info(fmt.Sprint("Upgrading blockchain database")) - - stack := utils.MakeNode(ctx, clientIdentifier, gitCommit) - chain, chainDb := utils.MakeChain(ctx, stack) - bcVersion := core.GetBlockChainVersion(chainDb) - if bcVersion == 0 { - bcVersion = core.BlockChainVersion - } - - // Export the current chain. - filename := fmt.Sprintf("blockchain_%d_%s.chain", bcVersion, time.Now().Format("20060102_150405")) - exportFile := filepath.Join(ctx.GlobalString(utils.DataDirFlag.Name), filename) - if err := utils.ExportChain(chain, exportFile); err != nil { - utils.Fatalf("Unable to export chain for reimport %s", err) - } - chainDb.Close() - if dir := dbDirectory(chainDb); dir != "" { - os.RemoveAll(dir) - } - - // Import the chain file. - chain, chainDb = utils.MakeChain(ctx, stack) - core.WriteBlockChainVersion(chainDb, core.BlockChainVersion) - err := utils.ImportChain(chain, exportFile) - chainDb.Close() - if err != nil { - utils.Fatalf("Import error %v (a backup is made in %s, use the import command to import it)", err, exportFile) - } else { - os.Remove(exportFile) - log.Info(fmt.Sprint("Import finished")) - } - return nil -} - -func dbDirectory(db ethdb.Database) string { - ldb, ok := db.(*ethdb.LDBDatabase) - if !ok { - return "" - } - return ldb.Path() -} - func dump(ctx *cli.Context) error { stack := makeFullNode(ctx) chain, chainDb := utils.MakeChain(ctx, stack) @@ -329,9 +275,3 @@ func hashish(x string) bool { _, err := strconv.Atoi(x) return err != nil } - -func closeAll(dbs ...ethdb.Database) { - for _, db := range dbs { - db.Close() - } -} diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 803a618f1..fa61f7386 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -65,7 +65,6 @@ func init() { initCommand, importCommand, exportCommand, - upgradedbCommand, removedbCommand, dumpCommand, // See monitorcmd.go: |