good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
993b4121
Commit
993b4121
authored
8 years ago
by
Péter Szilágyi
Browse files
Options
Downloads
Patches
Plain Diff
cmd/utils, eth: display the user's current fork, minor text tweak
parent
2c2e389b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmd/utils/flags.go
+19
-1
19 additions, 1 deletion
cmd/utils/flags.go
eth/handler_test.go
+1
-0
1 addition, 0 deletions
eth/handler_test.go
with
20 additions
and
1 deletion
cmd/utils/flags.go
+
19
−
1
View file @
993b4121
...
...
@@ -800,7 +800,8 @@ func MustMakeChainConfigFromDb(ctx *cli.Context, db ethdb.Database) *core.ChainC
// If the chain is already initialized, use any existing chain configs
config
:=
new
(
core
.
ChainConfig
)
if
genesis
:=
core
.
GetBlock
(
db
,
core
.
GetCanonicalHash
(
db
,
0
),
0
);
genesis
!=
nil
{
genesis
:=
core
.
GetBlock
(
db
,
core
.
GetCanonicalHash
(
db
,
0
),
0
)
if
genesis
!=
nil
{
storedConfig
,
err
:=
core
.
GetChainConfig
(
db
,
genesis
.
Hash
())
switch
err
{
case
nil
:
...
...
@@ -834,6 +835,23 @@ func MustMakeChainConfigFromDb(ctx *cli.Context, db ethdb.Database) *core.ChainC
case
ctx
.
GlobalBool
(
OpposeDAOFork
.
Name
)
:
config
.
DAOForkSupport
=
false
}
// Temporarilly display a proper message so the user knows which fork its on
if
!
ctx
.
GlobalBool
(
TestNetFlag
.
Name
)
&&
(
genesis
==
nil
||
genesis
.
Hash
()
==
common
.
HexToHash
(
"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3"
))
{
choice
:=
"SUPPORT"
if
!
config
.
DAOForkSupport
{
choice
=
"OPPOSE"
}
current
:=
fmt
.
Sprintf
(
"Geth is currently configured to %s the DAO hard-fork!"
,
choice
)
howtoswap
:=
fmt
.
Sprintf
(
"You can change your choice prior to block #%v with --support-dao-fork or --oppose-dao-fork."
,
config
.
DAOForkBlock
)
howtosync
:=
fmt
.
Sprintf
(
"After the hard-fork block #%v passed, changing chains requires a resync from scratch!"
,
config
.
DAOForkBlock
)
separator
:=
strings
.
Repeat
(
"-"
,
len
(
howtoswap
))
glog
.
V
(
logger
.
Warn
)
.
Info
(
separator
)
glog
.
V
(
logger
.
Warn
)
.
Info
(
current
)
glog
.
V
(
logger
.
Warn
)
.
Info
(
howtoswap
)
glog
.
V
(
logger
.
Warn
)
.
Info
(
howtosync
)
glog
.
V
(
logger
.
Warn
)
.
Info
(
separator
)
}
return
config
}
...
...
This diff is collapsed.
Click to expand it.
eth/handler_test.go
+
1
−
0
View file @
993b4121
...
...
@@ -638,6 +638,7 @@ func testDAOChallenge(t *testing.T, localForked, remoteForked bool, timeout bool
if
err
:=
p2p
.
Send
(
peer
.
app
,
BlockHeadersMsg
,
[]
*
types
.
Header
{
blocks
[
0
]
.
Header
()});
err
!=
nil
{
t
.
Fatalf
(
"failed to answer challenge: %v"
,
err
)
}
time
.
Sleep
(
100
*
time
.
Millisecond
)
// Sleep to avoid the verification racing with the drops
}
else
{
// Otherwise wait until the test timeout passes
time
.
Sleep
(
daoChallengeTimeout
+
500
*
time
.
Millisecond
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment