From e3da85faedf21a3ddb73a0fa29decf65364e6c39 Mon Sep 17 00:00:00 2001 From: obscuren Date: Sat, 10 Jan 2015 00:51:56 +0100 Subject: Implemented filter for ws + fixes * proper 0xhex * filters fixed * start of filter manager * accounts for ws. Closes #246 --- event/filter/old_filter.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'event') diff --git a/event/filter/old_filter.go b/event/filter/old_filter.go index 1a9a88173..6c7f053d4 100644 --- a/event/filter/old_filter.go +++ b/event/filter/old_filter.go @@ -2,6 +2,7 @@ package filter import ( + "fmt" "sync" "github.com/ethereum/go-ethereum/core" @@ -78,6 +79,7 @@ out: self.filterMu.RUnlock() case state.Messages: + fmt.Println("got messages") self.filterMu.RLock() for _, filter := range self.filters { if filter.MessageCallback != nil { -- cgit v1.2.3 From 35fe4313d57e1df6c3c8af0bc0b530bd7033e21b Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 12 Jan 2015 10:19:27 +0100 Subject: pre-pow --- event/filter/old_filter.go | 2 -- 1 file changed, 2 deletions(-) (limited to 'event') diff --git a/event/filter/old_filter.go b/event/filter/old_filter.go index 6c7f053d4..1a9a88173 100644 --- a/event/filter/old_filter.go +++ b/event/filter/old_filter.go @@ -2,7 +2,6 @@ package filter import ( - "fmt" "sync" "github.com/ethereum/go-ethereum/core" @@ -79,7 +78,6 @@ out: self.filterMu.RUnlock() case state.Messages: - fmt.Println("got messages") self.filterMu.RLock() for _, filter := range self.filters { if filter.MessageCallback != nil { -- cgit v1.2.3 From 34689cb3f369ad71164b81d0c05238d78cb67945 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 12 Jan 2015 20:36:45 +0100 Subject: Added manual triggering of filters --- event/filter/filter.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'event') diff --git a/event/filter/filter.go b/event/filter/filter.go index 9817d5782..ca767f413 100644 --- a/event/filter/filter.go +++ b/event/filter/filter.go @@ -68,3 +68,11 @@ out: } } } + +func (self *Filters) Match(a, b Filter) bool { + return reflect.TypeOf(a) == reflect.TypeOf(b) && a.Compare(b) +} + +func (self *Filters) Get(i int) Filter { + return self.watchers[i] +} -- cgit v1.2.3