From 1aac054d9a450e5c287b2e32c8209031754fdd4f Mon Sep 17 00:00:00 2001 From: jsvisa Date: Mon, 19 Aug 2024 15:18:47 +0000 Subject: [PATCH] fix(callflat): set ctx in live mode Signed-off-by: jsvisa --- eth/tracers/native/call_flat.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/eth/tracers/native/call_flat.go b/eth/tracers/native/call_flat.go index a47b79f8df..b1d7925003 100644 --- a/eth/tracers/native/call_flat.go +++ b/eth/tracers/native/call_flat.go @@ -214,6 +214,14 @@ func (t *flatCallTracer) OnTxEnd(receipt *types.Receipt, err error) { if t.interrupt.Load() { return } + if t.ctx == nil { + t.ctx = &tracers.Context{ + BlockHash: receipt.BlockHash, + BlockNumber: receipt.BlockNumber, + TxHash: receipt.TxHash, + TxIndex: int(receipt.TransactionIndex), + } + } t.tracer.OnTxEnd(receipt, err) }