native/flat: always set context from receipt

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
jsvisa 2024-08-20 07:14:09 +00:00
parent 8ba2c3db0e
commit 8750e2d975

View file

@ -220,14 +220,13 @@ func (t *flatCallTracer) OnTxEnd(receipt *types.Receipt, err error) {
if t.interrupt.Load() {
return
}
if t.ctx == nil {
// 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)
}