fix call flat receipt

Signed-off-by: jsvisa <delweng@gmail.com>
pull/30337/head
jsvisa 4 weeks ago
parent d9e7cef0c1
commit 7d351600b6
  1. 15
      eth/tracers/native/call_flat.go

@ -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)
}

Loading…
Cancel
Save