From d37978f2a7f5bd034292e7bf1314469f16797c3c Mon Sep 17 00:00:00 2001 From: Scott Fairclough Date: Thu, 19 Oct 2023 08:30:14 +0100 Subject: [PATCH] do not return nil when no filter changes are found --- jsonrpc/filter_manager.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jsonrpc/filter_manager.go b/jsonrpc/filter_manager.go index 072265b6a2..b0747e58b7 100644 --- a/jsonrpc/filter_manager.go +++ b/jsonrpc/filter_manager.go @@ -523,6 +523,13 @@ func (f *FilterManager) GetFilterChanges(id string) (interface{}, error) { f.Unlock() } + // if the result is nil then return an empty array to save the response going back to the client + // as null + r, ok := res.([]*Log) + if ok && len(r) == 0 { + return []interface{}{}, nil + } + return res, err }