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
6bd90080
Commit
6bd90080
authored
8 years ago
by
Hellsegga
Committed by
Péter Szilágyi
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/geth: set correct initial nonce on testnet for import/init subcommands (#2924)
parent
7d9c5e0f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
chaincmd.go
cmd/geth/chaincmd.go
+3
-0
main.go
cmd/geth/main.go
+5
-0
No files found.
cmd/geth/chaincmd.go
View file @
6bd90080
...
...
@@ -76,6 +76,9 @@ func importChain(ctx *cli.Context) error {
if
len
(
ctx
.
Args
())
!=
1
{
utils
.
Fatalf
(
"This command requires an argument."
)
}
if
ctx
.
GlobalBool
(
utils
.
TestNetFlag
.
Name
)
{
state
.
StartingNonce
=
1048576
// (2**20)
}
chain
,
chainDb
:=
utils
.
MakeChain
(
ctx
)
start
:=
time
.
Now
()
err
:=
utils
.
ImportChain
(
chain
,
ctx
.
Args
()
.
First
())
...
...
This diff is collapsed.
Click to expand it.
cmd/geth/main.go
View file @
6bd90080
...
...
@@ -33,6 +33,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/console"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/internal/debug"
...
...
@@ -266,6 +267,10 @@ func initGenesis(ctx *cli.Context) error {
utils
.
Fatalf
(
"must supply path to genesis JSON file"
)
}
if
ctx
.
GlobalBool
(
utils
.
TestNetFlag
.
Name
)
{
state
.
StartingNonce
=
1048576
// (2**20)
}
chainDb
,
err
:=
ethdb
.
NewLDBDatabase
(
filepath
.
Join
(
utils
.
MustMakeDataDir
(
ctx
),
"chaindata"
),
0
,
0
)
if
err
!=
nil
{
utils
.
Fatalf
(
"could not open database: %v"
,
err
)
...
...
This diff is collapsed.
Click to expand it.
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