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
e9a80518
Commit
e9a80518
authored
Sep 15, 2015
by
Jeffrey Wilcke
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1744 from kobigurk/develop
adds extradata flag
parents
55bdcfae
321733ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
main.go
cmd/geth/main.go
+15
-1
No files found.
cmd/geth/main.go
View file @
e9a80518
...
...
@@ -58,6 +58,11 @@ var (
gitCommit
string
// set via linker flagg
nodeNameVersion
string
app
*
cli
.
App
ExtraDataFlag
=
cli
.
StringFlag
{
Name
:
"extradata"
,
Usage
:
"Extra data for the miner"
,
}
)
func
init
()
{
...
...
@@ -331,6 +336,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
utils
.
GpobaseStepDownFlag
,
utils
.
GpobaseStepUpFlag
,
utils
.
GpobaseCorrectionFactorFlag
,
ExtraDataFlag
,
}
app
.
Before
=
func
(
ctx
*
cli
.
Context
)
error
{
utils
.
SetupLogger
(
ctx
)
...
...
@@ -354,6 +360,14 @@ func main() {
}
}
// MakeExtra resolves extradata for the miner from a flag or returns a default.
func
makeExtra
(
ctx
*
cli
.
Context
)
[]
byte
{
if
ctx
.
GlobalIsSet
(
ExtraDataFlag
.
Name
)
{
return
[]
byte
(
ctx
.
GlobalString
(
ExtraDataFlag
.
Name
))
}
return
makeDefaultExtra
()
}
func
makeDefaultExtra
()
[]
byte
{
var
clientInfo
=
struct
{
Version
uint
...
...
@@ -382,7 +396,7 @@ func run(ctx *cli.Context) {
}
cfg
:=
utils
.
MakeEthConfig
(
ClientIdentifier
,
nodeNameVersion
,
ctx
)
cfg
.
ExtraData
=
make
DefaultExtra
(
)
cfg
.
ExtraData
=
make
Extra
(
ctx
)
ethereum
,
err
:=
eth
.
New
(
cfg
)
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