aboutsummaryrefslogtreecommitdiffstats
path: root/miner/worker.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-02-27 00:48:39 +0800
committerPéter Szilágyi <peterke@gmail.com>2016-02-29 17:24:58 +0800
commitb534106cc81f4df3d1facb46450c775e2eb617b0 (patch)
treeadcdb56904fc1b864b3d0fe37c7e20311b1aa60f /miner/worker.go
parent85865a51b63cdbeaabb76a3729f9b8361a2616d7 (diff)
downloadgo-tangerine-b534106cc81f4df3d1facb46450c775e2eb617b0.tar
go-tangerine-b534106cc81f4df3d1facb46450c775e2eb617b0.tar.gz
go-tangerine-b534106cc81f4df3d1facb46450c775e2eb617b0.tar.bz2
go-tangerine-b534106cc81f4df3d1facb46450c775e2eb617b0.tar.lz
go-tangerine-b534106cc81f4df3d1facb46450c775e2eb617b0.tar.xz
go-tangerine-b534106cc81f4df3d1facb46450c775e2eb617b0.tar.zst
go-tangerine-b534106cc81f4df3d1facb46450c775e2eb617b0.zip
core, miner: add PendingStateEvent to track non-log updates
Diffstat (limited to 'miner/worker.go')
-rw-r--r--miner/worker.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/miner/worker.go b/miner/worker.go
index 71f22ef1c..f3e95cb5f 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -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)
}
}