Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
fdf939a6
Commit
fdf939a6
authored
Feb 28, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed miner threads for ethereum CLI
parent
cdb77f0e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
18 deletions
+22
-18
flags.go
cmd/ethereum/flags.go
+3
-0
main.go
cmd/ethereum/main.go
+19
-18
No files found.
cmd/ethereum/flags.go
View file @
fdf939a6
...
@@ -27,6 +27,7 @@ import (
...
@@ -27,6 +27,7 @@ import (
"log"
"log"
"os"
"os"
"path"
"path"
"runtime"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/ethutil"
...
@@ -71,6 +72,7 @@ var (
...
@@ -71,6 +72,7 @@ var (
SHH
bool
SHH
bool
Dial
bool
Dial
bool
PrintVersion
bool
PrintVersion
bool
MinerThreads
int
)
)
// flags specific to cli client
// flags specific to cli client
...
@@ -121,6 +123,7 @@ func Init() {
...
@@ -121,6 +123,7 @@ func Init() {
flag
.
BoolVar
(
&
StartMining
,
"mine"
,
false
,
"start dagger mining"
)
flag
.
BoolVar
(
&
StartMining
,
"mine"
,
false
,
"start dagger mining"
)
flag
.
BoolVar
(
&
StartJsConsole
,
"js"
,
false
,
"launches javascript console"
)
flag
.
BoolVar
(
&
StartJsConsole
,
"js"
,
false
,
"launches javascript console"
)
flag
.
BoolVar
(
&
PrintVersion
,
"version"
,
false
,
"prints version number"
)
flag
.
BoolVar
(
&
PrintVersion
,
"version"
,
false
,
"prints version number"
)
flag
.
IntVar
(
&
MinerThreads
,
"minerthreads"
,
runtime
.
NumCPU
(),
"number of miner threads"
)
// Network stuff
// Network stuff
var
(
var
(
...
...
cmd/ethereum/main.go
View file @
fdf939a6
...
@@ -62,20 +62,21 @@ func main() {
...
@@ -62,20 +62,21 @@ func main() {
utils
.
InitConfig
(
VmType
,
ConfigFile
,
Datadir
,
"ETH"
)
utils
.
InitConfig
(
VmType
,
ConfigFile
,
Datadir
,
"ETH"
)
ethereum
,
err
:=
eth
.
New
(
&
eth
.
Config
{
ethereum
,
err
:=
eth
.
New
(
&
eth
.
Config
{
Name
:
p2p
.
MakeName
(
ClientIdentifier
,
Version
),
Name
:
p2p
.
MakeName
(
ClientIdentifier
,
Version
),
KeyStore
:
KeyStore
,
KeyStore
:
KeyStore
,
DataDir
:
Datadir
,
DataDir
:
Datadir
,
LogFile
:
LogFile
,
LogFile
:
LogFile
,
LogLevel
:
LogLevel
,
LogLevel
:
LogLevel
,
LogFormat
:
LogFormat
,
LogFormat
:
LogFormat
,
MaxPeers
:
MaxPeer
,
MaxPeers
:
MaxPeer
,
Port
:
OutboundPort
,
Port
:
OutboundPort
,
NAT
:
NAT
,
NAT
:
NAT
,
KeyRing
:
KeyRing
,
KeyRing
:
KeyRing
,
Shh
:
true
,
Shh
:
true
,
Dial
:
Dial
,
Dial
:
Dial
,
BootNodes
:
BootNodes
,
BootNodes
:
BootNodes
,
NodeKey
:
NodeKey
,
NodeKey
:
NodeKey
,
MinerThreads
:
MinerThreads
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -113,10 +114,6 @@ func main() {
...
@@ -113,10 +114,6 @@ func main() {
return
return
}
}
if
StartMining
{
utils
.
StartMining
(
ethereum
)
}
if
len
(
ImportChain
)
>
0
{
if
len
(
ImportChain
)
>
0
{
start
:=
time
.
Now
()
start
:=
time
.
Now
()
err
:=
utils
.
ImportChain
(
ethereum
,
ImportChain
)
err
:=
utils
.
ImportChain
(
ethereum
,
ImportChain
)
...
@@ -139,6 +136,10 @@ func main() {
...
@@ -139,6 +136,10 @@ func main() {
fmt
.
Printf
(
"Welcome to the FRONTIER
\n
"
)
fmt
.
Printf
(
"Welcome to the FRONTIER
\n
"
)
if
StartMining
{
ethereum
.
Miner
()
.
Start
()
}
if
StartJsConsole
{
if
StartJsConsole
{
InitJsConsole
(
ethereum
)
InitJsConsole
(
ethereum
)
}
else
if
len
(
InputFile
)
>
0
{
}
else
if
len
(
InputFile
)
>
0
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment