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
ca298a28
Unverified
Commit
ca298a28
authored
Apr 13, 2022
by
Marius van der Wijden
Committed by
GitHub
Apr 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/geth: support bigints for --override.terminaltotaldifficulty (#24646)
Co-authored-by:
Felix Lange
<
fjl@twurst.com
>
parent
9c82c646
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
config.go
cmd/geth/config.go
+1
-1
customflags.go
cmd/utils/customflags.go
+3
-2
flags.go
cmd/utils/flags.go
+1
-1
No files found.
cmd/geth/config.go
View file @
ca298a28
...
@@ -160,7 +160,7 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
...
@@ -160,7 +160,7 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
cfg
.
Eth
.
OverrideArrowGlacier
=
new
(
big
.
Int
)
.
SetUint64
(
ctx
.
GlobalUint64
(
utils
.
OverrideArrowGlacierFlag
.
Name
))
cfg
.
Eth
.
OverrideArrowGlacier
=
new
(
big
.
Int
)
.
SetUint64
(
ctx
.
GlobalUint64
(
utils
.
OverrideArrowGlacierFlag
.
Name
))
}
}
if
ctx
.
GlobalIsSet
(
utils
.
OverrideTerminalTotalDifficulty
.
Name
)
{
if
ctx
.
GlobalIsSet
(
utils
.
OverrideTerminalTotalDifficulty
.
Name
)
{
cfg
.
Eth
.
OverrideTerminalTotalDifficulty
=
new
(
big
.
Int
)
.
SetUint64
(
ctx
.
GlobalUint64
(
utils
.
OverrideTerminalTotalDifficulty
.
Name
)
)
cfg
.
Eth
.
OverrideTerminalTotalDifficulty
=
utils
.
GlobalBig
(
ctx
,
utils
.
OverrideTerminalTotalDifficulty
.
Name
)
}
}
backend
,
eth
:=
utils
.
RegisterEthService
(
stack
,
&
cfg
.
Eth
)
backend
,
eth
:=
utils
.
RegisterEthService
(
stack
,
&
cfg
.
Eth
)
// Warn users to migrate if they have a legacy freezer format.
// Warn users to migrate if they have a legacy freezer format.
...
...
cmd/utils/customflags.go
View file @
ca298a28
...
@@ -154,11 +154,11 @@ func (b *bigValue) String() string {
...
@@ -154,11 +154,11 @@ func (b *bigValue) String() string {
}
}
func
(
b
*
bigValue
)
Set
(
s
string
)
error
{
func
(
b
*
bigValue
)
Set
(
s
string
)
error
{
int
,
ok
:=
math
.
ParseBig256
(
s
)
int
Val
,
ok
:=
math
.
ParseBig256
(
s
)
if
!
ok
{
if
!
ok
{
return
errors
.
New
(
"invalid integer syntax"
)
return
errors
.
New
(
"invalid integer syntax"
)
}
}
*
b
=
(
bigValue
)(
*
int
)
*
b
=
(
bigValue
)(
*
int
Val
)
return
nil
return
nil
}
}
...
@@ -172,6 +172,7 @@ func (f BigFlag) String() string {
...
@@ -172,6 +172,7 @@ func (f BigFlag) String() string {
func
(
f
BigFlag
)
Apply
(
set
*
flag
.
FlagSet
)
{
func
(
f
BigFlag
)
Apply
(
set
*
flag
.
FlagSet
)
{
eachName
(
f
.
Name
,
func
(
name
string
)
{
eachName
(
f
.
Name
,
func
(
name
string
)
{
f
.
Value
=
new
(
big
.
Int
)
set
.
Var
((
*
bigValue
)(
f
.
Value
),
f
.
Name
,
f
.
Usage
)
set
.
Var
((
*
bigValue
)(
f
.
Value
),
f
.
Name
,
f
.
Usage
)
})
})
}
}
...
...
cmd/utils/flags.go
View file @
ca298a28
...
@@ -258,7 +258,7 @@ var (
...
@@ -258,7 +258,7 @@ var (
Name
:
"override.arrowglacier"
,
Name
:
"override.arrowglacier"
,
Usage
:
"Manually specify Arrow Glacier fork-block, overriding the bundled setting"
,
Usage
:
"Manually specify Arrow Glacier fork-block, overriding the bundled setting"
,
}
}
OverrideTerminalTotalDifficulty
=
cli
.
Uint64
Flag
{
OverrideTerminalTotalDifficulty
=
Big
Flag
{
Name
:
"override.terminaltotaldifficulty"
,
Name
:
"override.terminaltotaldifficulty"
,
Usage
:
"Manually specify TerminalTotalDifficulty, overriding the bundled setting"
,
Usage
:
"Manually specify TerminalTotalDifficulty, overriding the bundled setting"
,
}
}
...
...
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