diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-20 08:14:27 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-20 08:14:27 +0800 |
commit | 22546dcb5528109de910e722cfc1afd5446eb3eb (patch) | |
tree | 2f5c7d30d204671b5e284f6c6bf8aa8aea9b178e /rpc | |
parent | b28e6d830606346d42d46ab657d3ba2b5b1a994e (diff) | |
download | dexon-22546dcb5528109de910e722cfc1afd5446eb3eb.tar dexon-22546dcb5528109de910e722cfc1afd5446eb3eb.tar.gz dexon-22546dcb5528109de910e722cfc1afd5446eb3eb.tar.bz2 dexon-22546dcb5528109de910e722cfc1afd5446eb3eb.tar.lz dexon-22546dcb5528109de910e722cfc1afd5446eb3eb.tar.xz dexon-22546dcb5528109de910e722cfc1afd5446eb3eb.tar.zst dexon-22546dcb5528109de910e722cfc1afd5446eb3eb.zip |
inline UninstallWhisperFilter
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/api.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/rpc/api.go b/rpc/api.go index 2b2467400..cd34934cf 100644 --- a/rpc/api.go +++ b/rpc/api.go @@ -320,12 +320,6 @@ func (p *EthereumApi) NewWhisperFilter(args *WhisperFilterArgs, reply *interface return nil } -func (p *EthereumApi) UninstallWhisperFilter(id int, reply *interface{}) error { - delete(p.messages, id) - *reply = true - return nil -} - func (self *EthereumApi) MessagesChanged(id int, reply *interface{}) error { self.messagesMut.Lock() defer self.messagesMut.Unlock() @@ -725,7 +719,12 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error if err := json.Unmarshal(req.Params, &args); err != nil { return err } - return p.UninstallWhisperFilter(args.Id, reply) + + if _, ok := p.messages[args.Id]; ok { + delete(p.messages, args.Id) + } + + *reply = true case "shh_getFilterChanges": args := new(FilterIdArgs) if err := json.Unmarshal(req.Params, &args); err != nil { |