Skip to content

Commit

Permalink
core: fix blockHash for eth_getLogs, eth_getFilterLogs, eth_getTransa…
Browse files Browse the repository at this point in the history
…ctionReceipt (ethereum#208)
  • Loading branch information
gzliudan committed Aug 31, 2023
1 parent f6b50b8 commit 02158d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/database_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/XinFinOrg/XDPoSChain/core/rawdb"
"math/big"

"github.com/XinFinOrg/XDPoSChain/common"
"github.com/XinFinOrg/XDPoSChain/core/rawdb"
"github.com/XinFinOrg/XDPoSChain/core/types"
"github.com/XinFinOrg/XDPoSChain/ethdb"
"github.com/XinFinOrg/XDPoSChain/log"
Expand Down Expand Up @@ -259,6 +259,10 @@ func GetBlockReceipts(db DatabaseReader, hash common.Hash, number uint64) types.
receipts := make(types.Receipts, len(storageReceipts))
for i, receipt := range storageReceipts {
receipts[i] = (*types.Receipt)(receipt)
for _, log := range receipts[i].Logs {
// update BlockHash to fix #208
log.BlockHash = hash
}
}
return receipts
}
Expand Down

0 comments on commit 02158d0

Please sign in to comment.