aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-07-16 17:14:20 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-07-16 19:30:09 +0800
commit1d6b65cd845b1360904dc1edc3285ae29472cf1b (patch)
tree9f68f219920386f6a047414ef51f95d5bc61380e /cmd/utils
parent1b2941cd56d69744e6121b7a590285d0faecbded (diff)
downloadgo-tangerine-1d6b65cd845b1360904dc1edc3285ae29472cf1b.tar
go-tangerine-1d6b65cd845b1360904dc1edc3285ae29472cf1b.tar.gz
go-tangerine-1d6b65cd845b1360904dc1edc3285ae29472cf1b.tar.bz2
go-tangerine-1d6b65cd845b1360904dc1edc3285ae29472cf1b.tar.lz
go-tangerine-1d6b65cd845b1360904dc1edc3285ae29472cf1b.tar.xz
go-tangerine-1d6b65cd845b1360904dc1edc3285ae29472cf1b.tar.zst
go-tangerine-1d6b65cd845b1360904dc1edc3285ae29472cf1b.zip
[release/1.4.10] cmd/utils, eth: display the user's current fork, minor text tweak
(cherry picked from commit 993b41216092fa6dc20d3755afe322cd1376b398)
Diffstat (limited to 'cmd/utils')
-rw-r--r--cmd/utils/flags.go20
1 files changed, 19 insertions, 1 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index df1dd1367..808cf7ca1 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -793,7 +793,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)); genesis != nil {
+ genesis := core.GetBlock(db, core.GetCanonicalHash(db, 0))
+ if genesis != nil {
storedConfig, err := core.GetChainConfig(db, genesis.Hash())
switch err {
case nil:
@@ -827,6 +828,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
}