aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/packages.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-09 07:06:24 +0800
committerobscuren <geffobscura@gmail.com>2015-02-09 07:06:24 +0800
commitb22f0f2ef51bdb769259b3cf7d9ee0e8e5b0635e (patch)
treeae9f28a4c89ba70b4ee2091aa1b6a564f7a05f48 /rpc/packages.go
parentac695387075fdd9214ef8de71ac6897136a50ce8 (diff)
parent16a04e64f23b7a81018c7fcf7626ca6965d9a809 (diff)
downloadgo-tangerine-b22f0f2ef51bdb769259b3cf7d9ee0e8e5b0635e.tar
go-tangerine-b22f0f2ef51bdb769259b3cf7d9ee0e8e5b0635e.tar.gz
go-tangerine-b22f0f2ef51bdb769259b3cf7d9ee0e8e5b0635e.tar.bz2
go-tangerine-b22f0f2ef51bdb769259b3cf7d9ee0e8e5b0635e.tar.lz
go-tangerine-b22f0f2ef51bdb769259b3cf7d9ee0e8e5b0635e.tar.xz
go-tangerine-b22f0f2ef51bdb769259b3cf7d9ee0e8e5b0635e.tar.zst
go-tangerine-b22f0f2ef51bdb769259b3cf7d9ee0e8e5b0635e.zip
merged
Diffstat (limited to 'rpc/packages.go')
-rw-r--r--rpc/packages.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/rpc/packages.go b/rpc/packages.go
index 047bbda9a..ac3127356 100644
--- a/rpc/packages.go
+++ b/rpc/packages.go
@@ -32,6 +32,7 @@ import (
"sync"
"github.com/ethereum/go-ethereum/core"
+ "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethutil"
@@ -88,6 +89,25 @@ func (self *EthereumApi) NewFilter(args *FilterOptions, reply *interface{}) erro
return nil
}
+func (self *EthereumApi) NewFilterString(args string, reply *interface{}) error {
+ var id int
+ filter := core.NewFilter(self.xeth.Backend())
+
+ callback := func(block *types.Block) {
+ self.logs[id] = append(self.logs[id], &state.StateLog{})
+ }
+ if args == "pending" {
+ filter.PendingCallback = callback
+ } else if args == "chain" {
+ filter.BlockCallback = callback
+ }
+
+ id = self.filterManager.InstallFilter(filter)
+ *reply = id
+
+ return nil
+}
+
func (self *EthereumApi) FilterChanged(id int, reply *interface{}) error {
self.logMut.RLock()
defer self.logMut.RUnlock()
@@ -389,6 +409,12 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
return err
}
return p.NewFilter(args, reply)
+ case "eth_newFilterString":
+ args, err := req.ToFilterStringArgs()
+ if err != nil {
+ return err
+ }
+ return p.NewFilterString(args, reply)
case "eth_changed":
args, err := req.ToFilterChangedArgs()
if err != nil {