@@ -793,7 +793,8 @@ func MustMakeChainConfigFromDb(ctx *cli.Context, db ethdb.Database) *core.ChainC
793
793
// If the chain is already initialized, use any existing chain configs
794
794
config := new (core.ChainConfig )
795
795
796
- if genesis := core .GetBlock (db , core .GetCanonicalHash (db , 0 )); genesis != nil {
796
+ genesis := core .GetBlock (db , core .GetCanonicalHash (db , 0 ))
797
+ if genesis != nil {
797
798
storedConfig , err := core .GetChainConfig (db , genesis .Hash ())
798
799
switch err {
799
800
case nil :
@@ -827,6 +828,23 @@ func MustMakeChainConfigFromDb(ctx *cli.Context, db ethdb.Database) *core.ChainC
827
828
case ctx .GlobalBool (OpposeDAOFork .Name ):
828
829
config .DAOForkSupport = false
829
830
}
831
+ // Temporarilly display a proper message so the user knows which fork its on
832
+ if ! ctx .GlobalBool (TestNetFlag .Name ) && (genesis == nil || genesis .Hash () == common .HexToHash ("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3" )) {
833
+ choice := "SUPPORT"
834
+ if ! config .DAOForkSupport {
835
+ choice = "OPPOSE"
836
+ }
837
+ current := fmt .Sprintf ("Geth is currently configured to %s the DAO hard-fork!" , choice )
838
+ howtoswap := fmt .Sprintf ("You can change your choice prior to block #%v with --support-dao-fork or --oppose-dao-fork." , config .DAOForkBlock )
839
+ howtosync := fmt .Sprintf ("After the hard-fork block #%v passed, changing chains requires a resync from scratch!" , config .DAOForkBlock )
840
+ separator := strings .Repeat ("-" , len (howtoswap ))
841
+
842
+ glog .V (logger .Warn ).Info (separator )
843
+ glog .V (logger .Warn ).Info (current )
844
+ glog .V (logger .Warn ).Info (howtoswap )
845
+ glog .V (logger .Warn ).Info (howtosync )
846
+ glog .V (logger .Warn ).Info (separator )
847
+ }
830
848
return config
831
849
}
832
850
0 commit comments