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
2729e629
Commit
2729e629
authored
Jun 06, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved error checking
parent
ed621aae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
chaincmd.go
cmd/geth/chaincmd.go
+7
-3
No files found.
cmd/geth/chaincmd.go
View file @
2729e629
...
...
@@ -76,16 +76,20 @@ func exportChain(ctx *cli.Context) {
start
:=
time
.
Now
()
var
err
error
fp
:=
ctx
.
Args
()
.
First
()
if
len
(
ctx
.
Args
())
<
3
{
err
=
utils
.
ExportChain
(
chain
,
ctx
.
Args
()
.
First
()
)
err
=
utils
.
ExportChain
(
chain
,
fp
)
}
else
{
// This can be improved to allow for numbers larger than 9223372036854775807
first
,
ferr
:=
strconv
.
ParseInt
(
ctx
.
Args
()
.
Get
(
1
),
10
,
64
)
last
,
lerr
:=
strconv
.
ParseInt
(
ctx
.
Args
()
.
Get
(
2
),
10
,
64
)
if
ferr
!=
nil
||
lerr
!=
nil
{
utils
.
Fatalf
(
"Export error in parsing parameters
\n
"
)
utils
.
Fatalf
(
"Export error in parsing parameters
: block number not an integer
\n
"
)
}
err
=
utils
.
ExportAppendChain
(
chain
,
ctx
.
Args
()
.
First
(),
uint64
(
first
),
uint64
(
last
))
if
first
<
0
||
last
<
0
{
utils
.
Fatalf
(
"Export error: block number must be greater than 0
\n
"
)
}
err
=
utils
.
ExportAppendChain
(
chain
,
fp
,
uint64
(
first
),
uint64
(
last
))
}
if
err
!=
nil
{
...
...
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