aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-06-29 16:53:06 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-06-29 16:53:06 +0800
commit3eef19598e02ee02ad27c36978bf4ba4b6d41493 (patch)
tree4dd2d499b0acc00a027fca6b072a4b21860191da /cmd
parentf4aebd4c8defaae0343fbed61c56e16642969489 (diff)
downloadgo-tangerine-3eef19598e02ee02ad27c36978bf4ba4b6d41493.tar
go-tangerine-3eef19598e02ee02ad27c36978bf4ba4b6d41493.tar.gz
go-tangerine-3eef19598e02ee02ad27c36978bf4ba4b6d41493.tar.bz2
go-tangerine-3eef19598e02ee02ad27c36978bf4ba4b6d41493.tar.lz
go-tangerine-3eef19598e02ee02ad27c36978bf4ba4b6d41493.tar.xz
go-tangerine-3eef19598e02ee02ad27c36978bf4ba4b6d41493.tar.zst
go-tangerine-3eef19598e02ee02ad27c36978bf4ba4b6d41493.zip
[release/1.4.9] Revert "core: update DAO soft-fork number, clean up the code"
This reverts commit aefffc9ed8ca60ebe58e06066b30f1283493f488.
Diffstat (limited to 'cmd')
-rw-r--r--cmd/geth/main.go1
-rw-r--r--cmd/geth/usage.go1
-rw-r--r--cmd/utils/flags.go23
3 files changed, 16 insertions, 9 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index 878b90deb..c58013c1a 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -169,7 +169,6 @@ participating.
utils.MiningGPUFlag,
utils.AutoDAGFlag,
utils.TargetGasLimitFlag,
- utils.DAOSoftForkFlag,
utils.NATFlag,
utils.NatspecEnabledFlag,
utils.NoDiscoverFlag,
diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go
index 10bc56b97..e7ef9e2c7 100644
--- a/cmd/geth/usage.go
+++ b/cmd/geth/usage.go
@@ -128,7 +128,6 @@ var AppHelpFlagGroups = []flagGroup{
utils.TargetGasLimitFlag,
utils.GasPriceFlag,
utils.ExtraDataFlag,
- utils.DAOSoftForkFlag,
},
},
{
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 2521f47ea..8413289ce 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -163,6 +163,10 @@ var (
}
// Miner settings
// 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{
Name: "mine",
Usage: "Enable mining",
@@ -181,10 +185,6 @@ var (
Usage: "Target gas limit sets the artificial target gas floor for the blocks to mine",
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{
Name: "autodag",
Usage: "Enable automatic DAG pregeneration",
@@ -644,6 +644,16 @@ func MakePasswordList(ctx *cli.Context) []string {
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
// assembles the P2P protocol stack.
func 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,
}
// Configure the Ethereum service
accman := MakeAccountManager(ctx)
-
- // Handle some miner strategies arrising from the DAO fiasco
- core.DAOSoftFork = ctx.GlobalBool(DAOSoftForkFlag.Name)
+ // parse the blocked code hashes and set them to the core package.
+ core.BlockedCodeHashes = MakeBlockedCodeHashes(ctx)
// initialise new random number generator
rand := rand.New(rand.NewSource(time.Now().UnixNano()))