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
94b12f78
Commit
94b12f78
authored
Jul 14, 2014
by
zelig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix start mining
parent
353ecbb7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
cmd.go
utils/cmd.go
+3
-4
No files found.
utils/cmd.go
View file @
94b12f78
...
...
@@ -124,6 +124,7 @@ func NewDatabase() ethutil.Database {
}
func
NewClientIdentity
(
clientIdentifier
,
version
,
customIdentifier
string
)
*
ethwire
.
SimpleClientIdentity
{
logger
.
Infoln
(
"identity created"
)
return
ethwire
.
NewSimpleClientIdentity
(
clientIdentifier
,
version
,
customIdentifier
)
}
...
...
@@ -209,10 +210,10 @@ var miner ethminer.Miner
func
StartMining
(
ethereum
*
eth
.
Ethereum
)
bool
{
if
!
ethereum
.
Mining
{
ethereum
.
Mining
=
true
addr
:=
ethereum
.
KeyManager
()
.
Address
()
go
func
()
{
logger
.
Infoln
(
"Start mining"
)
miner
=
ethminer
.
NewDefaultMiner
(
addr
,
ethereum
)
// Give it some time to connect with peers
time
.
Sleep
(
3
*
time
.
Second
)
...
...
@@ -220,8 +221,6 @@ func StartMining(ethereum *eth.Ethereum) bool {
time
.
Sleep
(
5
*
time
.
Second
)
}
logger
.
Infoln
(
"Miner started"
)
miner
:=
ethminer
.
NewDefaultMiner
(
addr
,
ethereum
)
miner
.
Start
()
}()
RegisterInterrupt
(
func
(
os
.
Signal
)
{
...
...
@@ -235,7 +234,7 @@ func StartMining(ethereum *eth.Ethereum) bool {
func
StopMining
(
ethereum
*
eth
.
Ethereum
)
bool
{
if
ethereum
.
Mining
{
miner
.
Stop
()
logger
.
Infoln
(
"
Miner stopped
"
)
logger
.
Infoln
(
"
Stopped mining
"
)
ethereum
.
Mining
=
false
return
true
}
...
...
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