diff options
author | Felix Lange <fjl@twurst.com> | 2015-05-28 07:20:03 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-05-28 07:20:58 +0800 |
commit | e84bbcce3c335b863eb6304ad910047054b68c20 (patch) | |
tree | a8bfda6c9e36631272e531ed2538d40e5bf1763b /cmd | |
parent | e1fe75e3b637758f99ddbcaeb01eafa1a0b6455e (diff) | |
download | go-tangerine-e84bbcce3c335b863eb6304ad910047054b68c20.tar.gz go-tangerine-e84bbcce3c335b863eb6304ad910047054b68c20.tar.zst go-tangerine-e84bbcce3c335b863eb6304ad910047054b68c20.zip |
cmd/geth: don't flush databases after import
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/geth/chaincmd.go | 9 |
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() } } |