@@ -163,6 +163,10 @@ var (
163163 }
164164 // Miner settings
165165 // TODO: refactor CPU vs GPU mining flags
166+ BlockedCodeHashesFlag = cli.StringFlag {
167+ Name : "blocked-code-hashes" ,
168+ Usage : "Comma separated list of code-hashes to ignore any interaction from" ,
169+ }
166170 MiningEnabledFlag = cli.BoolFlag {
167171 Name : "mine" ,
168172 Usage : "Enable mining" ,
@@ -181,10 +185,6 @@ var (
181185 Usage : "Target gas limit sets the artificial target gas floor for the blocks to mine" ,
182186 Value : params .GenesisGasLimit .String (),
183187 }
184- DAOSoftForkFlag = cli.BoolFlag {
185- Name : "dao-soft-fork" ,
186- Usage : "Vote for the DAO soft-fork, temporarilly decreasing the gas limits" ,
187- }
188188 AutoDAGFlag = cli.BoolFlag {
189189 Name : "autodag" ,
190190 Usage : "Enable automatic DAG pregeneration" ,
@@ -644,6 +644,16 @@ func MakePasswordList(ctx *cli.Context) []string {
644644 return lines
645645}
646646
647+ // MakeBlockedCodeHashes parses a comma separated list of hashes.
648+ func MakeBlockedCodeHashes (ctx * cli.Context ) map [common.Hash ]struct {} {
649+ splittedHexHashes := strings .Split (ctx .GlobalString (BlockedCodeHashesFlag .Name ), "," )
650+ illegalCodeHashes := make (map [common.Hash ]struct {})
651+ for _ , hexHash := range splittedHexHashes {
652+ illegalCodeHashes [common .HexToHash (strings .TrimSpace (hexHash ))] = struct {}{}
653+ }
654+ return illegalCodeHashes
655+ }
656+
647657// MakeSystemNode sets up a local node, configures the services to launch and
648658// assembles the P2P protocol stack.
649659func MakeSystemNode (name , version string , relconf release.Config , extra []byte , ctx * cli.Context ) * node.Node {
@@ -680,9 +690,8 @@ func MakeSystemNode(name, version string, relconf release.Config, extra []byte,
680690 }
681691 // Configure the Ethereum service
682692 accman := MakeAccountManager (ctx )
683-
684- // Handle some miner strategies arrising from the DAO fiasco
685- core .DAOSoftFork = ctx .GlobalBool (DAOSoftForkFlag .Name )
693+ // parse the blocked code hashes and set them to the core package.
694+ core .BlockedCodeHashes = MakeBlockedCodeHashes (ctx )
686695
687696 // initialise new random number generator
688697 rand := rand .New (rand .NewSource (time .Now ().UnixNano ()))
0 commit comments