aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-05-11 21:43:14 +0800
committerobscuren <geffobscura@gmail.com>2015-05-11 23:21:22 +0800
commit21e52efdfed19c4376b830f8ad0e52a9e599f633 (patch)
treea3d6f2be23c64881461892572adc9d1b55cd4b39 /cmd/geth
parent064cf1609987bb0f6c59c1e790b7811d9a783fef (diff)
downloadgo-tangerine-21e52efdfed19c4376b830f8ad0e52a9e599f633.tar
go-tangerine-21e52efdfed19c4376b830f8ad0e52a9e599f633.tar.gz
go-tangerine-21e52efdfed19c4376b830f8ad0e52a9e599f633.tar.bz2
go-tangerine-21e52efdfed19c4376b830f8ad0e52a9e599f633.tar.lz
go-tangerine-21e52efdfed19c4376b830f8ad0e52a9e599f633.tar.xz
go-tangerine-21e52efdfed19c4376b830f8ad0e52a9e599f633.tar.zst
go-tangerine-21e52efdfed19c4376b830f8ad0e52a9e599f633.zip
cmd/geth, miner, backend, xeth: Fixed miner threads to be settable
Miner threads are now settable through the admin interface (closes #897) and specify 0 CPU worker threads when eth_getWork is called (closes #916)
Diffstat (limited to 'cmd/geth')
-rw-r--r--cmd/geth/admin.go5
-rw-r--r--cmd/geth/main.go2
2 files changed, 3 insertions, 4 deletions
diff --git a/cmd/geth/admin.go b/cmd/geth/admin.go
index 2b9956638..17d711297 100644
--- a/cmd/geth/admin.go
+++ b/cmd/geth/admin.go
@@ -275,14 +275,13 @@ func (js *jsre) verbosity(call otto.FunctionCall) otto.Value {
}
func (js *jsre) startMining(call otto.FunctionCall) otto.Value {
- _, err := call.Argument(0).ToInteger()
+ threads, err := call.Argument(0).ToInteger()
if err != nil {
fmt.Println(err)
return otto.FalseValue()
}
- // threads now ignored
- err = js.ethereum.StartMining()
+ err = js.ethereum.StartMining(int(threads))
if err != nil {
fmt.Println(err)
return otto.FalseValue()
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index fd7aae4c2..5da59ff3b 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -401,7 +401,7 @@ func startEth(ctx *cli.Context, eth *eth.Ethereum) {
}
}
if ctx.GlobalBool(utils.MiningEnabledFlag.Name) {
- if err := eth.StartMining(); err != nil {
+ if err := eth.StartMining(ctx.GlobalInt(utils.MinerThreadsFlag.Name)); err != nil {
utils.Fatalf("%v", err)
}
}