diff options
author | obscuren <geffobscura@gmail.com> | 2015-02-06 03:55:03 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-02-06 03:55:03 +0800 |
commit | c64852dbccd0c8eb57cab994aefd0243c65b351b (patch) | |
tree | 84104fd5d12afbd0c3f53311d9b000d22e8935c3 /event | |
parent | bcacaaa4f418d51751cd841a22a8455b165f2375 (diff) | |
download | dexon-c64852dbccd0c8eb57cab994aefd0243c65b351b.tar.gz dexon-c64852dbccd0c8eb57cab994aefd0243c65b351b.tar.zst dexon-c64852dbccd0c8eb57cab994aefd0243c65b351b.zip |
pending / chain event
Diffstat (limited to 'event')
-rw-r--r-- | event/filter/old_filter.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/event/filter/old_filter.go b/event/filter/old_filter.go index 4c01572db..ab0127ffb 100644 --- a/event/filter/old_filter.go +++ b/event/filter/old_filter.go @@ -59,7 +59,7 @@ func (self *FilterManager) GetFilter(id int) *core.Filter { func (self *FilterManager) filterLoop() { // Subscribe to events - events := self.eventMux.Subscribe(core.NewBlockEvent{}, state.Logs(nil)) + events := self.eventMux.Subscribe(core.PendingBlockEvent{}, core.NewBlockEvent{}, state.Logs(nil)) out: for { @@ -77,6 +77,15 @@ out: } self.filterMu.RUnlock() + case core.PendingBlockEvent: + self.filterMu.RLock() + for _, filter := range self.filters { + if filter.PendingCallback != nil { + filter.PendingCallback(event.Block) + } + } + self.filterMu.RUnlock() + case state.Logs: self.filterMu.RLock() for _, filter := range self.filters { |