mirror of https://github.com/status-im/op-geth.git
Fixed miner threads for ethereum CLI
This commit is contained in:
parent
cdb77f0ecd
commit
fdf939a6f9
|
@ -27,6 +27,7 @@ import (
|
|||
"log"
|
||||
"os"
|
||||
"path"
|
||||
"runtime"
|
||||
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/ethutil"
|
||||
|
@ -71,6 +72,7 @@ var (
|
|||
SHH bool
|
||||
Dial bool
|
||||
PrintVersion bool
|
||||
MinerThreads int
|
||||
)
|
||||
|
||||
// flags specific to cli client
|
||||
|
@ -121,6 +123,7 @@ func Init() {
|
|||
flag.BoolVar(&StartMining, "mine", false, "start dagger mining")
|
||||
flag.BoolVar(&StartJsConsole, "js", false, "launches javascript console")
|
||||
flag.BoolVar(&PrintVersion, "version", false, "prints version number")
|
||||
flag.IntVar(&MinerThreads, "minerthreads", runtime.NumCPU(), "number of miner threads")
|
||||
|
||||
// Network stuff
|
||||
var (
|
||||
|
|
|
@ -76,6 +76,7 @@ func main() {
|
|||
Dial: Dial,
|
||||
BootNodes: BootNodes,
|
||||
NodeKey: NodeKey,
|
||||
MinerThreads: MinerThreads,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
|
@ -113,10 +114,6 @@ func main() {
|
|||
return
|
||||
}
|
||||
|
||||
if StartMining {
|
||||
utils.StartMining(ethereum)
|
||||
}
|
||||
|
||||
if len(ImportChain) > 0 {
|
||||
start := time.Now()
|
||||
err := utils.ImportChain(ethereum, ImportChain)
|
||||
|
@ -139,6 +136,10 @@ func main() {
|
|||
|
||||
fmt.Printf("Welcome to the FRONTIER\n")
|
||||
|
||||
if StartMining {
|
||||
ethereum.Miner().Start()
|
||||
}
|
||||
|
||||
if StartJsConsole {
|
||||
InitJsConsole(ethereum)
|
||||
} else if len(InputFile) > 0 {
|
||||
|
|
Loading…
Reference in New Issue