fix call flat receipt

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

@ -211,14 +211,17 @@ func (t *flatCallTracer) OnTxStart(env *tracing.VMContext, tx *types.Transaction
} }
func (t *flatCallTracer) OnTxEnd(receipt *types.Receipt, err error) { func (t *flatCallTracer) OnTxEnd(receipt *types.Receipt, err error) {
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{ t.ctx = &tracers.Context{
BlockHash: receipt.BlockHash, BlockHash: receipt.BlockHash,
BlockNumber: receipt.BlockNumber, BlockNumber: receipt.BlockNumber,
TxIndex: int(receipt.TransactionIndex), TxIndex: int(receipt.TransactionIndex),
TxHash: receipt.TxHash, TxHash: receipt.TxHash,
} }
if t.interrupt.Load() {
return
} }
t.tracer.OnTxEnd(receipt, err) t.tracer.OnTxEnd(receipt, err)
} }

Loading…
Cancel
Save