From 5f6cb5313031dbd99b47052e205bd347913062a3 Mon Sep 17 00:00:00 2001 From: jsvisa Date: Tue, 20 Aug 2024 07:14:09 +0000 Subject: [PATCH] native/flat: always set context from receipt Signed-off-by: jsvisa --- eth/tracers/native/call_flat.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/eth/tracers/native/call_flat.go b/eth/tracers/native/call_flat.go index 3fe8f357ca..658623455c 100644 --- a/eth/tracers/native/call_flat.go +++ b/eth/tracers/native/call_flat.go @@ -220,13 +220,12 @@ 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), - } + // Always set context with receipt data. + t.ctx = &tracers.Context{ + BlockHash: receipt.BlockHash, + BlockNumber: receipt.BlockNumber, + TxHash: receipt.TxHash, + TxIndex: int(receipt.TransactionIndex), } t.tracer.OnTxEnd(receipt, err) }