Skip to content

Commit

Permalink
fix call flat receipt
Browse files Browse the repository at this point in the history
Signed-off-by: jsvisa <[email protected]>
  • Loading branch information
jsvisa committed Aug 22, 2024
1 parent ad76d8e commit 2614efd
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions eth/tracers/native/call_flat.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,18 @@ func (t *flatCallTracer) OnTxStart(env *tracing.VMContext, tx *types.Transaction
}

func (t *flatCallTracer) OnTxEnd(receipt *types.Receipt, err error) {
t.ctx = &tracers.Context{
BlockHash: receipt.BlockHash,
BlockNumber: receipt.BlockNumber,
TxIndex: int(receipt.TransactionIndex),
TxHash: receipt.TxHash,
}
if t.interrupt.Load() {
return
}
// Set the context for the tracer only if receipt is available and no error occured
if err == nil && receipt != nil {
t.ctx = &tracers.Context{
BlockHash: receipt.BlockHash,
BlockNumber: receipt.BlockNumber,
TxIndex: int(receipt.TransactionIndex),
TxHash: receipt.TxHash,
}
}
t.tracer.OnTxEnd(receipt, err)
}

Expand Down

0 comments on commit 2614efd

Please sign in to comment.