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
064279c0
Commit
064279c0
authored
Mar 18, 2015
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/ethereum, cmd/utils: partial fix for chain import
parent
d15f9064
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
admin.go
cmd/ethereum/admin.go
+1
-4
cmd.go
cmd/utils/cmd.go
+3
-4
No files found.
cmd/ethereum/admin.go
View file @
064279c0
...
...
@@ -221,13 +221,10 @@ func (js *jsre) exportChain(call otto.FunctionCall) otto.Value {
fmt
.
Println
(
err
)
return
otto
.
FalseValue
()
}
data
:=
js
.
ethereum
.
ChainManager
()
.
Export
()
if
err
:=
common
.
WriteFile
(
fn
,
data
);
err
!=
nil
{
if
err
:=
utils
.
ExportChain
(
js
.
ethereum
.
ChainManager
(),
fn
);
err
!=
nil
{
fmt
.
Println
(
err
)
return
otto
.
FalseValue
()
}
return
otto
.
TrueValue
()
}
...
...
cmd/utils/cmd.go
View file @
064279c0
...
...
@@ -158,13 +158,12 @@ func ImportChain(chainmgr *core.ChainManager, fn string) error {
var
i
int
for
;
;
i
++
{
var
b
types
.
Block
err
:=
stream
.
Decode
(
&
b
)
if
err
==
io
.
EOF
{
if
err
:=
stream
.
Decode
(
&
b
);
err
==
io
.
EOF
{
break
}
else
if
err
!=
nil
{
return
fmt
.
Errorf
(
"at block %d: %v"
,
i
,
err
)
}
if
err
:=
chainmgr
.
InsertChain
(
types
.
Blocks
{
b
});
err
!=
nil
{
if
err
:=
chainmgr
.
InsertChain
(
types
.
Blocks
{
&
b
});
err
!=
nil
{
return
fmt
.
Errorf
(
"invalid block %d: %v"
,
i
,
err
)
}
}
...
...
@@ -174,7 +173,7 @@ func ImportChain(chainmgr *core.ChainManager, fn string) error {
func
ExportChain
(
chainmgr
*
core
.
ChainManager
,
fn
string
)
error
{
fmt
.
Printf
(
"exporting blockchain '%s'
\n
"
,
fn
)
fh
,
err
:=
os
.
OpenFile
(
fn
,
os
.
O_WRONLY
|
os
.
O_TRUNC
,
os
.
ModePerm
)
fh
,
err
:=
os
.
OpenFile
(
fn
,
os
.
O_
CREATE
|
os
.
O_
WRONLY
|
os
.
O_TRUNC
,
os
.
ModePerm
)
if
err
!=
nil
{
return
err
}
...
...
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