aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api.go
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-03-12 13:01:18 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-03-12 13:01:18 +0800
commit704914be08d0ec6398bd8bec9b1e04103ea0395d (patch)
tree8b4d1127300217a14ea1f8e9801a223de094c95f /rpc/api.go
parent7ee5cb0a81f9ccc0efec2a5bf830c7566f3289ad (diff)
downloadgo-tangerine-704914be08d0ec6398bd8bec9b1e04103ea0395d.tar
go-tangerine-704914be08d0ec6398bd8bec9b1e04103ea0395d.tar.gz
go-tangerine-704914be08d0ec6398bd8bec9b1e04103ea0395d.tar.bz2
go-tangerine-704914be08d0ec6398bd8bec9b1e04103ea0395d.tar.lz
go-tangerine-704914be08d0ec6398bd8bec9b1e04103ea0395d.tar.xz
go-tangerine-704914be08d0ec6398bd8bec9b1e04103ea0395d.tar.zst
go-tangerine-704914be08d0ec6398bd8bec9b1e04103ea0395d.zip
Check for existance of key before delete
Diffstat (limited to 'rpc/api.go')
-rw-r--r--rpc/api.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/rpc/api.go b/rpc/api.go
index 90e5dcf37..ba6c54d64 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