aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'rpc/api.go')
-rw-r--r--rpc/api.go19
1 files changed, 16 insertions, 3 deletions
diff --git a/rpc/api.go b/rpc/api.go
index 8bbe80bd8..44b8ee834 100644
--- a/rpc/api.go
+++ b/rpc/api.go
@@ -167,7 +167,10 @@ func (self *EthereumApi) NewFilter(args *FilterOptions, reply *interface{}) erro
}
func (self *EthereumApi) UninstallFilter(id int, reply *interface{}) error {
- delete(self.logs, id)
+ if _, ok := self.logs[id]; ok {
+ delete(self.logs, id)
+ }
+
self.filterManager.UninstallFilter(id)
*reply = true
return nil
@@ -377,7 +380,13 @@ func (p *EthereumApi) NewWhisperFilter(args *WhisperFilterArgs, reply *interface
}
id = p.xeth().Whisper().Watch(opts)
p.messages[id] = &whisperFilter{timeout: time.Now()}
- *reply = id
+ *reply = toHex(big.NewInt(int64(id)).Bytes())
+ return nil
+}
+
+func (p *EthereumApi) UninstallWhisperFilter(id int, reply *interface{}) error {
+ delete(p.messages, id)
+ *reply = true
return nil
}
@@ -733,7 +742,11 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
}
return p.NewWhisperFilter(args, reply)
case "shh_uninstallFilter":
- return errNotImplemented
+ args := new(FilterIdArgs)
+ if err := json.Unmarshal(req.Params, &args); err != nil {
+ return err
+ }
+ return p.UninstallWhisperFilter(args.Id, reply)
case "shh_getFilterChanges":
args := new(FilterIdArgs)
if err := json.Unmarshal(req.Params, &args); err != nil {