From 693190e5b95a9c5914268199c02ad67e0e11ab9e Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Wed, 16 Oct 2024 11:00:58 +0800 Subject: [PATCH] core: fix wrong blockHash for eth_getLogs (#650) --- core/database_util.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/database_util.go b/core/database_util.go index 9d48ffec6c..e65ac0ff8e 100644 --- a/core/database_util.go +++ b/core/database_util.go @@ -262,6 +262,10 @@ func GetBlockReceipts(db DatabaseReader, hash common.Hash, number uint64) types. receipts[i].BlockHash = hash receipts[i].BlockNumber = big.NewInt(0).SetUint64(number) receipts[i].TransactionIndex = uint(i) + for _, log := range receipts[i].Logs { + // set BlockHash to fix #650 + log.BlockHash = hash + } } return receipts }