pending / chain event
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user