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
f702e274
Commit
f702e274
authored
Jul 18, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed miner stopping / starting:wq
parent
0c5a747e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
cmd.go
utils/cmd.go
+8
-2
No files found.
utils/cmd.go
View file @
f702e274
...
...
@@ -247,7 +247,10 @@ func StartMining(ethereum *eth.Ethereum) bool {
addr
:=
ethereum
.
KeyManager
()
.
Address
()
go
func
()
{
if
miner
==
nil
{
miner
=
ethminer
.
NewDefaultMiner
(
addr
,
ethereum
)
}
// Give it some time to connect with peers
time
.
Sleep
(
3
*
time
.
Second
)
for
!
ethereum
.
IsUpToDate
()
{
...
...
@@ -255,7 +258,6 @@ func StartMining(ethereum *eth.Ethereum) bool {
}
logger
.
Infoln
(
"Miner started"
)
miner
:=
ethminer
.
NewDefaultMiner
(
addr
,
ethereum
)
miner
.
Start
()
}()
RegisterInterrupt
(
func
(
os
.
Signal
)
{
...
...
@@ -269,10 +271,14 @@ func StartMining(ethereum *eth.Ethereum) bool {
func
StopMining
(
ethereum
*
eth
.
Ethereum
)
bool
{
if
ethereum
.
Mining
&&
miner
!=
nil
{
miner
.
Stop
()
logger
.
Infoln
(
"Miner stopped"
)
ethereum
.
Mining
=
false
return
true
}
return
false
}
...
...
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