diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-20 19:07:06 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-20 19:07:06 +0800 |
commit | 55fdf3e46272ec50a4d55f519b542df790920306 (patch) | |
tree | 34f5fdd4551b03a6c69f3639f3f1f715aa6d9b99 /event | |
parent | b4a51de6020ce0fdee47eb6c7d63a13647b7e3c4 (diff) | |
download | dexon-55fdf3e46272ec50a4d55f519b542df790920306.tar.gz dexon-55fdf3e46272ec50a4d55f519b542df790920306.tar.zst dexon-55fdf3e46272ec50a4d55f519b542df790920306.zip |
Listen to tx pre event and trigger 'pending'
Diffstat (limited to 'event')
-rw-r--r-- | event/filter/eth_filter.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/event/filter/eth_filter.go b/event/filter/eth_filter.go index cb75d7e1a..ab811e90e 100644 --- a/event/filter/eth_filter.go +++ b/event/filter/eth_filter.go @@ -62,8 +62,9 @@ func (self *FilterManager) GetFilter(id int) *core.Filter { func (self *FilterManager) filterLoop() { // Subscribe to events events := self.eventMux.Subscribe( - core.PendingBlockEvent{}, + //core.PendingBlockEvent{}, core.ChainEvent{}, + core.TxPreEvent{}, state.Logs(nil)) out: @@ -82,11 +83,11 @@ out: } self.filterMu.RUnlock() - case core.PendingBlockEvent: + case core.TxPreEvent: self.filterMu.RLock() for _, filter := range self.filters { if filter.PendingCallback != nil { - filter.PendingCallback(event.Block, event.Logs) + filter.PendingCallback(event.Tx) } } self.filterMu.RUnlock() |