core: fix wrong blockHash for eth_getLogs (#650)

This commit is contained in:
Daniel Liu 2024-10-16 11:00:58 +08:00
parent 22c54206bd
commit 693190e5b9

View file

@ -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
}