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
b534106c
Commit
b534106c
authored
Feb 26, 2016
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core, miner: add PendingStateEvent to track non-log updates
parent
85865a51
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
events.go
core/events.go
+3
-0
worker.go
miner/worker.go
+9
-2
No files found.
core/events.go
View file @
b534106c
...
...
@@ -35,6 +35,9 @@ type PendingLogsEvent struct {
Logs
vm
.
Logs
}
// PendingStateEvent is posted pre mining and notifies of pending state changes.
type
PendingStateEvent
struct
{}
// NewBlockEvent is posted when a block has been imported.
type
NewBlockEvent
struct
{
Block
*
types
.
Block
}
...
...
miner/worker.go
View file @
b534106c
...
...
@@ -649,8 +649,15 @@ func (env *Work) commitTransactions(mux *event.TypeMux, transactions types.Trans
coalescedLogs
=
append
(
coalescedLogs
,
logs
...
)
}
}
if
len
(
coalescedLogs
)
>
0
{
go
mux
.
Post
(
core
.
PendingLogsEvent
{
Logs
:
coalescedLogs
})
if
len
(
coalescedLogs
)
>
0
||
env
.
tcount
>
0
{
go
func
(
logs
vm
.
Logs
,
tcount
int
)
{
if
len
(
logs
)
>
0
{
mux
.
Post
(
core
.
PendingLogsEvent
{
Logs
:
logs
})
}
if
tcount
>
0
{
mux
.
Post
(
core
.
PendingStateEvent
{})
}
}(
coalescedLogs
,
env
.
tcount
)
}
}
...
...
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