From 26d58e0446521f725616b5a5d1b9d1ac04837f00 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 17 Feb 2015 22:46:30 +0100 Subject: [PATCH] Forgot to add the case for logs. Closes #336 --- rpc/packages.go | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/rpc/packages.go b/rpc/packages.go index 4d21945711..8aa604aa55 100644 --- a/rpc/packages.go +++ b/rpc/packages.go @@ -1,21 +1,4 @@ /* - This file is part of go-ethereum - - go-ethereum is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - go-ethereum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with go-ethereum. If not, see . -*/ -/* - For each request type, define the following: 1. RpcRequest "To" method [message.go], which does basic validation and conversion to "Args" type via json.Decoder() @@ -160,7 +143,9 @@ func (self *EthereumApi) Logs(id int, reply *interface{}) error { defer self.logMut.Unlock() filter := self.filterManager.GetFilter(id) - *reply = toLogs(filter.Find()) + if filter != nil { + *reply = toLogs(filter.Find()) + } return nil } @@ -465,6 +450,12 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error return err } return p.FilterChanged(args, reply) + case "eth_filterLogs": + args, err := req.ToFilterChangedArgs() + if err != nil { + return err + } + return p.Logs(args, reply) case "eth_gasPrice": *reply = defaultGasPrice return nil