Merge branch 'main' into requestmanager

pull/3560/head
Rongjian Lan 4 years ago committed by GitHub
commit c999991f35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      hmy/blockchain.go

@ -314,10 +314,19 @@ func (hmy *Harmony) GetLogs(ctx context.Context, blockHash common.Hash, isEth bo
return nil, errors.New("Missing receipts")
}
if isEth {
block := hmy.BlockChain.GetBlockByHash(blockHash)
if block != nil {
return nil, errors.New("Missing block data")
}
txns := block.Transactions()
for i, _ := range receipts {
for j, _ := range receipts[i].Logs {
// Override log txHash with receipt's
receipts[i].Logs[j].TxHash = receipts[i].TxHash
if i < len(txns) {
ethHash := txns[i].ConvertToEth().Hash()
receipts[i].TxHash = ethHash
for j, _ := range receipts[i].Logs {
// Override log txHash with receipt's
receipts[i].Logs[j].TxHash = ethHash
}
}
}
}

Loading…
Cancel
Save