good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
94b12f78
Commit
94b12f78
authored
10 years ago
by
Viktor Trón
Browse files
Options
Downloads
Patches
Plain Diff
fix start mining
parent
353ecbb7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
utils/cmd.go
+3
-4
3 additions, 4 deletions
utils/cmd.go
with
3 additions
and
4 deletions
utils/cmd.go
+
3
−
4
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
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment