diff --git a/eth/filters/api.go b/eth/filters/api.go index aef9adba103f..6d35c2fba287 100644 --- a/eth/filters/api.go +++ b/eth/filters/api.go @@ -341,6 +341,11 @@ func (api *PublicFilterAPI) GetLogs(ctx context.Context, crit FilterCriteria) ([ if err != nil { return nil, err } + // update BlockHash to fix #208 (eth_getLogs previously returned the + // receipt's blockHash, which is wrong on XDPoS; use the canonical hash) + for _, log := range logs { + log.BlockHash = core.GetCanonicalHash(api.chainDb, log.BlockNumber) + } return returnLogs(logs), err } @@ -389,6 +394,10 @@ func (api *PublicFilterAPI) GetFilterLogs(ctx context.Context, id rpc.ID) ([]*ty if err != nil { return nil, err } + // update BlockHash to fix #208 + for _, log := range logs { + log.BlockHash = core.GetCanonicalHash(api.chainDb, log.BlockNumber) + } return returnLogs(logs), nil }