|
|
@ -163,10 +163,6 @@ var ( |
|
|
|
} |
|
|
|
} |
|
|
|
// Miner settings
|
|
|
|
// Miner settings
|
|
|
|
// TODO: refactor CPU vs GPU mining flags
|
|
|
|
// TODO: refactor CPU vs GPU mining flags
|
|
|
|
BlockedCodeHashesFlag = cli.StringFlag{ |
|
|
|
|
|
|
|
Name: "blocked-code-hashes", |
|
|
|
|
|
|
|
Usage: "Comma separated list of code-hashes to ignore any interaction from", |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
MiningEnabledFlag = cli.BoolFlag{ |
|
|
|
MiningEnabledFlag = cli.BoolFlag{ |
|
|
|
Name: "mine", |
|
|
|
Name: "mine", |
|
|
|
Usage: "Enable mining", |
|
|
|
Usage: "Enable mining", |
|
|
@ -185,6 +181,10 @@ var ( |
|
|
|
Usage: "Target gas limit sets the artificial target gas floor for the blocks to mine", |
|
|
|
Usage: "Target gas limit sets the artificial target gas floor for the blocks to mine", |
|
|
|
Value: params.GenesisGasLimit.String(), |
|
|
|
Value: params.GenesisGasLimit.String(), |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
DAOSoftForkFlag = cli.BoolFlag{ |
|
|
|
|
|
|
|
Name: "dao-soft-fork", |
|
|
|
|
|
|
|
Usage: "Vote for the DAO soft-fork, temporarilly decreasing the gas limits", |
|
|
|
|
|
|
|
} |
|
|
|
AutoDAGFlag = cli.BoolFlag{ |
|
|
|
AutoDAGFlag = cli.BoolFlag{ |
|
|
|
Name: "autodag", |
|
|
|
Name: "autodag", |
|
|
|
Usage: "Enable automatic DAG pregeneration", |
|
|
|
Usage: "Enable automatic DAG pregeneration", |
|
|
@ -644,16 +644,6 @@ func MakePasswordList(ctx *cli.Context) []string { |
|
|
|
return lines |
|
|
|
return lines |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// MakeBlockedCodeHashes parses a comma separated list of hashes.
|
|
|
|
|
|
|
|
func MakeBlockedCodeHashes(ctx *cli.Context) map[common.Hash]struct{} { |
|
|
|
|
|
|
|
splittedHexHashes := strings.Split(ctx.GlobalString(BlockedCodeHashesFlag.Name), ",") |
|
|
|
|
|
|
|
illegalCodeHashes := make(map[common.Hash]struct{}) |
|
|
|
|
|
|
|
for _, hexHash := range splittedHexHashes { |
|
|
|
|
|
|
|
illegalCodeHashes[common.HexToHash(strings.TrimSpace(hexHash))] = struct{}{} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return illegalCodeHashes |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// MakeSystemNode sets up a local node, configures the services to launch and
|
|
|
|
// MakeSystemNode sets up a local node, configures the services to launch and
|
|
|
|
// assembles the P2P protocol stack.
|
|
|
|
// assembles the P2P protocol stack.
|
|
|
|
func MakeSystemNode(name, version string, relconf release.Config, extra []byte, ctx *cli.Context) *node.Node { |
|
|
|
func MakeSystemNode(name, version string, relconf release.Config, extra []byte, ctx *cli.Context) *node.Node { |
|
|
@ -690,8 +680,9 @@ func MakeSystemNode(name, version string, relconf release.Config, extra []byte, |
|
|
|
} |
|
|
|
} |
|
|
|
// Configure the Ethereum service
|
|
|
|
// Configure the Ethereum service
|
|
|
|
accman := MakeAccountManager(ctx) |
|
|
|
accman := MakeAccountManager(ctx) |
|
|
|
// parse the blocked code hashes and set them to the core package.
|
|
|
|
|
|
|
|
core.BlockedCodeHashes = MakeBlockedCodeHashes(ctx) |
|
|
|
// Handle some miner strategies arrising from the DAO fiasco
|
|
|
|
|
|
|
|
core.DAOSoftFork = ctx.GlobalBool(DAOSoftForkFlag.Name) |
|
|
|
|
|
|
|
|
|
|
|
// initialise new random number generator
|
|
|
|
// initialise new random number generator
|
|
|
|
rand := rand.New(rand.NewSource(time.Now().UnixNano())) |
|
|
|
rand := rand.New(rand.NewSource(time.Now().UnixNano())) |
|
|
|