From f1563edfb3b111f72f80600d511e90feb304ec92 Mon Sep 17 00:00:00 2001 From: conomist Date: Thu, 12 Feb 2026 16:02:09 +0100 Subject: [PATCH] Update math.go --- core/filtermaps/math.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/filtermaps/math.go b/core/filtermaps/math.go index 68fd6debd6..9f6d42623a 100644 --- a/core/filtermaps/math.go +++ b/core/filtermaps/math.go @@ -93,18 +93,18 @@ func (p *Params) deriveFields() { // addressValue returns the log value hash of a log emitting address. func addressValue(address common.Address) common.Hash { - var result common.Hash - hasher := sha256.New() - hasher.Write(address[:]) - hasher.Sum(result[:0]) - return result + return sha256Value(address[:]) } // topicValue returns the log value hash of a log topic. func topicValue(topic common.Hash) common.Hash { + return sha256Value(topic[:]) +} + +func sha256Value(value []byte) common.Hash { var result common.Hash hasher := sha256.New() - hasher.Write(topic[:]) + hasher.Write(value) hasher.Sum(result[:0]) return result }