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
8e995b97
Commit
8e995b97
authored
Mar 03, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes and debug added
parent
40ff3cac
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
6 deletions
+8
-6
main.go
cmd/ethereum/main.go
+0
-4
agent.go
miner/agent.go
+6
-1
miner.go
miner/miner.go
+1
-0
worker.go
miner/worker.go
+1
-1
No files found.
cmd/ethereum/main.go
View file @
8e995b97
...
...
@@ -114,10 +114,6 @@ func main() {
return
}
if
StartMining
{
ethereum
.
Miner
()
.
Start
()
}
if
len
(
ImportChain
)
>
0
{
start
:=
time
.
Now
()
err
:=
utils
.
ImportChain
(
ethereum
,
ImportChain
)
...
...
miner/agent.go
View file @
8e995b97
...
...
@@ -42,11 +42,16 @@ func (self *CpuMiner) Start() {
}
func
(
self
*
CpuMiner
)
update
()
{
justStarted
:=
true
out
:
for
{
select
{
case
block
:=
<-
self
.
c
:
self
.
quitCurrentOp
<-
struct
{}{}
if
justStarted
{
justStarted
=
true
}
else
{
self
.
quitCurrentOp
<-
struct
{}{}
}
go
self
.
mine
(
block
)
case
<-
self
.
quit
:
...
...
miner/miner.go
View file @
8e995b97
...
...
@@ -29,6 +29,7 @@ func New(coinbase []byte, eth core.Backend, pow pow.PoW, minerThreads int) *Mine
pow
:
pow
,
}
minerThreads
=
1
for
i
:=
0
;
i
<
minerThreads
;
i
++
{
miner
.
worker
.
register
(
NewCpuMiner
(
i
,
miner
.
pow
))
}
...
...
miner/worker.go
View file @
8e995b97
...
...
@@ -151,10 +151,10 @@ func (self *worker) wait() {
self
.
current
.
block
.
Header
()
.
Nonce
=
work
.
Nonce
self
.
current
.
block
.
Header
()
.
MixDigest
=
work
.
MixDigest
self
.
current
.
block
.
Header
()
.
SeedHash
=
work
.
SeedHash
fmt
.
Println
(
self
.
current
.
block
)
if
err
:=
self
.
chain
.
InsertChain
(
types
.
Blocks
{
self
.
current
.
block
});
err
==
nil
{
self
.
mux
.
Post
(
core
.
NewMinedBlockEvent
{
self
.
current
.
block
})
fmt
.
Println
(
"GOOD BLOCK"
,
self
.
current
.
block
)
}
else
{
self
.
commitNewWork
()
}
...
...
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