diff --git a/rpc/eth_rpc.go b/rpc/eth_rpc.go index bbdab52..4374c01 100644 --- a/rpc/eth_rpc.go +++ b/rpc/eth_rpc.go @@ -64,10 +64,13 @@ func (rpc EthBlockChainRPC) GetLogs( filterParam := ethrpc.FilterParams{ FromBlock: "0x" + strconv.FormatUint(fromBlockNum, 16), ToBlock: "0x" + strconv.FormatUint(toBlockNum, 16), - Address: []string{address}, Topics: [][]string{topics}, } + if address != "" { + filterParam.Address = []string{address} + } + logs, err := rpc.rpcImpl.EthGetLogs(filterParam) if err != nil { logrus.Warnf("EthGetLogs err: %s, params: %+v", err, filterParam)