aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils/flags.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-08-13 22:03:16 +0800
committerGitHub <noreply@github.com>2018-08-13 22:03:16 +0800
commitd8328a96b4943798f9dd2a8ae1c787f7e78ff8e4 (patch)
tree8caca301cbd28fa62fbd45ee47dced38f2acd57b /cmd/utils/flags.go
parentfb368723acf83e64c71e1eaa403e7cda06e6ce5e (diff)
parentf0998415ba9a73f0add32f9b5aed2aec98b9a7f3 (diff)
downloaddexon-d8328a96b4943798f9dd2a8ae1c787f7e78ff8e4.tar.gz
dexon-d8328a96b4943798f9dd2a8ae1c787f7e78ff8e4.tar.zst
dexon-d8328a96b4943798f9dd2a8ae1c787f7e78ff8e4.zip
Merge pull request #17347 from karalabe/miner-notify
cmd, consensus/ethash, eth: miner push notifications
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r--cmd/utils/flags.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 522ad06b6..d6142f246 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -24,7 +24,6 @@ import (
"math/big"
"os"
"path/filepath"
- "runtime"
"strconv"
"strings"
"time"
@@ -318,9 +317,13 @@ var (
Usage: "Enable mining",
}
MinerThreadsFlag = cli.IntFlag{
- Name: "minerthreads",
+ Name: "miner.threads",
Usage: "Number of CPU threads to use for mining",
- Value: runtime.NumCPU(),
+ Value: 0,
+ }
+ MinerNotifyFlag = cli.StringFlag{
+ Name: "miner.notify",
+ Usage: "Comma separated HTTP URL list to notify of new work packages",
}
TargetGasLimitFlag = cli.Uint64Flag{
Name: "targetgaslimit",
@@ -1093,6 +1096,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
if ctx.GlobalIsSet(MinerThreadsFlag.Name) {
cfg.MinerThreads = ctx.GlobalInt(MinerThreadsFlag.Name)
}
+ if ctx.GlobalIsSet(MinerNotifyFlag.Name) {
+ cfg.MinerNotify = strings.Split(ctx.GlobalString(MinerNotifyFlag.Name), ",")
+ }
if ctx.GlobalIsSet(DocRootFlag.Name) {
cfg.DocRoot = ctx.GlobalString(DocRootFlag.Name)
}
@@ -1293,7 +1299,7 @@ func MakeChain(ctx *cli.Context, stack *node.Node) (chain *core.BlockChain, chai
DatasetDir: stack.ResolvePath(eth.DefaultConfig.Ethash.DatasetDir),
DatasetsInMem: eth.DefaultConfig.Ethash.DatasetsInMem,
DatasetsOnDisk: eth.DefaultConfig.Ethash.DatasetsOnDisk,
- })
+ }, nil)
}
}
if gcmode := ctx.GlobalString(GCModeFlag.Name); gcmode != "full" && gcmode != "archive" {