aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth/chaincmd.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-05-28 07:20:03 +0800
committerFelix Lange <fjl@twurst.com>2015-05-28 07:20:58 +0800
commite84bbcce3c335b863eb6304ad910047054b68c20 (patch)
treea8bfda6c9e36631272e531ed2538d40e5bf1763b /cmd/geth/chaincmd.go
parente1fe75e3b637758f99ddbcaeb01eafa1a0b6455e (diff)
downloaddexon-e84bbcce3c335b863eb6304ad910047054b68c20.tar
dexon-e84bbcce3c335b863eb6304ad910047054b68c20.tar.gz
dexon-e84bbcce3c335b863eb6304ad910047054b68c20.tar.bz2
dexon-e84bbcce3c335b863eb6304ad910047054b68c20.tar.lz
dexon-e84bbcce3c335b863eb6304ad910047054b68c20.tar.xz
dexon-e84bbcce3c335b863eb6304ad910047054b68c20.tar.zst
dexon-e84bbcce3c335b863eb6304ad910047054b68c20.zip
cmd/geth: don't flush databases after import
Diffstat (limited to 'cmd/geth/chaincmd.go')
-rw-r--r--cmd/geth/chaincmd.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go
index 6245c691b..947532f40 100644
--- a/cmd/geth/chaincmd.go
+++ b/cmd/geth/chaincmd.go
@@ -55,7 +55,7 @@ func importChain(ctx *cli.Context) {
chain, blockDB, stateDB, extraDB := utils.MakeChain(ctx)
start := time.Now()
err := utils.ImportChain(chain, ctx.Args().First())
- flushAll(blockDB, stateDB, extraDB)
+ closeAll(blockDB, stateDB, extraDB)
if err != nil {
utils.Fatalf("Import error: %v", err)
}
@@ -109,7 +109,7 @@ func upgradeDB(ctx *cli.Context) {
if err := utils.ExportChain(chain, exportFile); err != nil {
utils.Fatalf("Unable to export chain for reimport %s", err)
}
- flushAll(blockDB, stateDB, extraDB)
+ closeAll(blockDB, stateDB, extraDB)
os.RemoveAll(filepath.Join(ctx.GlobalString(utils.DataDirFlag.Name), "blockchain"))
os.RemoveAll(filepath.Join(ctx.GlobalString(utils.DataDirFlag.Name), "state"))
@@ -117,7 +117,7 @@ func upgradeDB(ctx *cli.Context) {
chain, blockDB, stateDB, extraDB = utils.MakeChain(ctx)
blockDB.Put([]byte("BlockchainVersion"), common.NewValue(core.BlockChainVersion).Bytes())
err := utils.ImportChain(chain, exportFile)
- flushAll(blockDB, stateDB, extraDB)
+ closeAll(blockDB, stateDB, extraDB)
if err != nil {
utils.Fatalf("Import error %v (a backup is made in %s, use the import command to import it)", err, exportFile)
} else {
@@ -152,9 +152,8 @@ func hashish(x string) bool {
return err != nil
}
-func flushAll(dbs ...common.Database) {
+func closeAll(dbs ...common.Database) {
for _, db := range dbs {
- db.Flush()
db.Close()
}
}