From b75c384beecbdb39b749cd4570bcb1ec2b5ad08e Mon Sep 17 00:00:00 2001 From: marukai67 Date: Thu, 29 Jan 2026 16:52:08 +0100 Subject: [PATCH] Update filter_system.go --- eth/filters/filter_system.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eth/filters/filter_system.go b/eth/filters/filter_system.go index 1f92c4e36f..44224654fb 100644 --- a/eth/filters/filter_system.go +++ b/eth/filters/filter_system.go @@ -115,7 +115,11 @@ func (sys *FilterSystem) cachedLogElem(ctx context.Context, blockHash common.Has } // Database logs are un-derived. // Fill in whatever we can (txHash is inaccessible at this point). - flattened := make([]*types.Log, 0) + total := 0 + for _, txLogs := range logs { + total += len(txLogs) + } + flattened := make([]*types.Log, 0, total) var logIdx uint for i, txLogs := range logs { for _, log := range txLogs {