Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
e84bbcce
Commit
e84bbcce
authored
May 27, 2015
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/geth: don't flush databases after import
parent
e1fe75e3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
chaincmd.go
cmd/geth/chaincmd.go
+4
-5
No files found.
cmd/geth/chaincmd.go
View file @
e84bbcce
...
...
@@ -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
())
flush
All
(
blockDB
,
stateDB
,
extraDB
)
close
All
(
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
)
}
flush
All
(
blockDB
,
stateDB
,
extraDB
)
close
All
(
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
)
flush
All
(
blockDB
,
stateDB
,
extraDB
)
close
All
(
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
flush
All
(
dbs
...
common
.
Database
)
{
func
close
All
(
dbs
...
common
.
Database
)
{
for
_
,
db
:=
range
dbs
{
db
.
Flush
()
db
.
Close
()
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment