Skip to content

Commit

Permalink
eth/filters: fix blockHash in eth_getfilterchanges (ethereum#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
gzliudan committed Aug 31, 2023
1 parent 02158d0 commit 9e860e4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions eth/filters/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
ethereum "github.com/XinFinOrg/XDPoSChain"
"github.com/XinFinOrg/XDPoSChain/common"
"github.com/XinFinOrg/XDPoSChain/common/hexutil"
"github.com/XinFinOrg/XDPoSChain/core"
"github.com/XinFinOrg/XDPoSChain/core/types"
"github.com/XinFinOrg/XDPoSChain/ethdb"
"github.com/XinFinOrg/XDPoSChain/event"
Expand Down Expand Up @@ -418,6 +419,10 @@ func (api *PublicFilterAPI) GetFilterChanges(id rpc.ID) (interface{}, error) {
case LogsSubscription:
logs := f.logs
f.logs = nil
for _, log := range logs {
// update BlockHash to fix #208
log.BlockHash = core.GetCanonicalHash(api.chainDb, log.BlockNumber)
}
return returnLogs(logs), nil
}
}
Expand Down

0 comments on commit 9e860e4

Please sign in to comment.