diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-06-22 20:54:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-22 20:54:24 +0800 |
commit | c98d9b49bf695d7ca0716ccff0d5a78dccac8110 (patch) | |
tree | fd16b082737619fa98eb0240ef593f26eff0fb87 | |
parent | 0042f13d47700987e93e413be549b312e81854ac (diff) | |
parent | d43268888679d9038e22534532a4dac4e0dbf12d (diff) | |
download | dexon-c98d9b49bf695d7ca0716ccff0d5a78dccac8110.tar.gz dexon-c98d9b49bf695d7ca0716ccff0d5a78dccac8110.tar.zst dexon-c98d9b49bf695d7ca0716ccff0d5a78dccac8110.zip |
Merge pull request #14677 from karalabe/miner-cli-gasprice
cmd/geth: corrently init gas price for CLI CPU mining
-rw-r--r-- | cmd/geth/main.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go index cc481796f..b5cdd712d 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -252,10 +252,12 @@ func startNode(ctx *cli.Context, stack *node.Node) { }() // Start auxiliary services if enabled if ctx.GlobalBool(utils.MiningEnabledFlag.Name) { + // Mining only makes sense if a full Ethereum node is running var ethereum *eth.Ethereum if err := stack.Service(ðereum); err != nil { utils.Fatalf("ethereum service not running: %v", err) } + // Use a reduced number of threads if requested if threads := ctx.GlobalInt(utils.MinerThreadsFlag.Name); threads > 0 { type threaded interface { SetThreads(threads int) @@ -264,6 +266,8 @@ func startNode(ctx *cli.Context, stack *node.Node) { th.SetThreads(threads) } } + // Set the gas price to the limits from the CLI and start mining + ethereum.TxPool().SetGasPrice(utils.GlobalBig(ctx, utils.GasPriceFlag.Name)) if err := ethereum.StartMining(true); err != nil { utils.Fatalf("Failed to start mining: %v", err) } |