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
9be7853e
Commit
9be7853e
authored
Mar 23, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issues with stalled remote miner
parent
dc3a9379
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
remote_agent.go
miner/remote_agent.go
+1
-1
worker.go
miner/worker.go
+8
-3
No files found.
miner/remote_agent.go
View file @
9be7853e
...
...
@@ -17,7 +17,6 @@ type RemoteAgent struct {
func
NewRemoteAgent
()
*
RemoteAgent
{
agent
:=
&
RemoteAgent
{}
go
agent
.
run
()
return
agent
}
...
...
@@ -33,6 +32,7 @@ func (a *RemoteAgent) SetWorkCh(returnCh chan<- Work) {
func
(
a
*
RemoteAgent
)
Start
()
{
a
.
quit
=
make
(
chan
struct
{})
a
.
workCh
=
make
(
chan
*
types
.
Block
,
1
)
go
a
.
run
()
}
func
(
a
*
RemoteAgent
)
Stop
()
{
...
...
miner/worker.go
View file @
9be7853e
...
...
@@ -213,9 +213,11 @@ func (self *worker) commitNewWork() {
transactions
:=
self
.
eth
.
TxPool
()
.
GetTransactions
()
sort
.
Sort
(
types
.
TxByNonce
{
transactions
})
minerlogger
.
Infof
(
"committing new work with %d txs
\n
"
,
len
(
transactions
))
// Keep track of transactions which return errors so they can be removed
var
remove
types
.
Transactions
var
(
remove
types
.
Transactions
tcount
=
0
)
gasLimit
:
for
i
,
tx
:=
range
transactions
{
err
:=
self
.
commitTransaction
(
tx
)
...
...
@@ -233,6 +235,8 @@ gasLimit:
minerlogger
.
Infof
(
"Gas limit reached for block. %d TXs included in this block
\n
"
,
i
)
// Break on gas limit
break
gasLimit
default
:
tcount
++
}
}
self
.
eth
.
TxPool
()
.
RemoveSet
(
remove
)
...
...
@@ -251,7 +255,8 @@ gasLimit:
uncles
=
append
(
uncles
,
uncle
.
Header
())
}
}
minerlogger
.
Infoln
(
"Included"
,
len
(
uncles
),
"uncle(s)"
)
minerlogger
.
Infof
(
"commit new work with %d txs & %d uncles
\n
"
,
tcount
,
len
(
uncles
))
self
.
current
.
block
.
SetUncles
(
uncles
)
self
.
current
.
state
.
AddBalance
(
self
.
coinbase
,
core
.
BlockReward
)
...
...
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