aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-06-22 19:58:07 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-06-22 19:58:07 +0800
commitd43268888679d9038e22534532a4dac4e0dbf12d (patch)
tree59cfc6af03efd61d2188613d12647408ce1daa2c /cmd
parent58a1e13e6dd7f52a1d5e67bee47d23fd6cfdee5c (diff)
downloadgo-tangerine-d43268888679d9038e22534532a4dac4e0dbf12d.tar
go-tangerine-d43268888679d9038e22534532a4dac4e0dbf12d.tar.gz
go-tangerine-d43268888679d9038e22534532a4dac4e0dbf12d.tar.bz2
go-tangerine-d43268888679d9038e22534532a4dac4e0dbf12d.tar.lz
go-tangerine-d43268888679d9038e22534532a4dac4e0dbf12d.tar.xz
go-tangerine-d43268888679d9038e22534532a4dac4e0dbf12d.tar.zst
go-tangerine-d43268888679d9038e22534532a4dac4e0dbf12d.zip
cmd/geth: corrently init gas price for CLI CPU mining
Diffstat (limited to 'cmd')
-rw-r--r--cmd/geth/main.go4
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(&ethereum); 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)
}