File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -252,10 +252,12 @@ func startNode(ctx *cli.Context, stack *node.Node) {
252
252
}()
253
253
// Start auxiliary services if enabled
254
254
if ctx .GlobalBool (utils .MiningEnabledFlag .Name ) {
255
+ // Mining only makes sense if a full Ethereum node is running
255
256
var ethereum * eth.Ethereum
256
257
if err := stack .Service (& ethereum ); err != nil {
257
258
utils .Fatalf ("ethereum service not running: %v" , err )
258
259
}
260
+ // Use a reduced number of threads if requested
259
261
if threads := ctx .GlobalInt (utils .MinerThreadsFlag .Name ); threads > 0 {
260
262
type threaded interface {
261
263
SetThreads (threads int )
@@ -264,6 +266,8 @@ func startNode(ctx *cli.Context, stack *node.Node) {
264
266
th .SetThreads (threads )
265
267
}
266
268
}
269
+ // Set the gas price to the limits from the CLI and start mining
270
+ ethereum .TxPool ().SetGasPrice (utils .GlobalBig (ctx , utils .GasPriceFlag .Name ))
267
271
if err := ethereum .StartMining (true ); err != nil {
268
272
utils .Fatalf ("Failed to start mining: %v" , err )
269
273
}
You can’t perform that action at this time.
0 commit comments