Skip to content

Commit

Permalink
chg: add check
Browse files Browse the repository at this point in the history
  • Loading branch information
bladehan1 committed Apr 2, 2024
1 parent b23e0a6 commit 9ce223e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1448,12 +1448,16 @@ func newRPCTransactionFromBlockIndex(b *types.Block, index uint64, db ethdb.Data
txs := b.Transactions()
var borReceipt *types.Receipt

if index >= uint64(len(txs)+1) {
return nil
}

// Read bor receipts if a state-sync transaction is requested
if index == uint64(len(txs)) {
borReceipt = rawdb.ReadBorReceipt(db, b.Hash(), b.NumberU64())
if borReceipt != nil {
if borReceipt.TxHash != (common.Hash{}) {
tx, _, _, _ := rawdb.ReadBorTransaction(db, borReceipt.TxHash)
tx, _, _, _ := rawdb.ReadBorTransactionWithBlockHash(db, borReceipt.TxHash, b.Hash())

if tx != nil {
txs = append(txs, tx)
Expand Down

0 comments on commit 9ce223e

Please sign in to comment.