mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-23 07:04:35 +00:00
Merge pull request #320 from gzliudan/fix-issue-208
return right blockHash in logs
This commit is contained in:
commit
9e00cc595e
2 changed files with 10 additions and 1 deletions
|
|
@ -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"
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue