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,13 +220,12 @@ func (t *flatCallTracer) OnTxEnd(receipt *types.Receipt, err error) {
if t.interrupt.Load() { if t.interrupt.Load() {
return return
} }
if t.ctx == nil { // Always set context with receipt data.
t.ctx = &tracers.Context{ t.ctx = &tracers.Context{
BlockHash: receipt.BlockHash, BlockHash: receipt.BlockHash,
BlockNumber: receipt.BlockNumber, BlockNumber: receipt.BlockNumber,
TxHash: receipt.TxHash, TxHash: receipt.TxHash,
TxIndex: int(receipt.TransactionIndex), TxIndex: int(receipt.TransactionIndex),
}
} }
t.tracer.OnTxEnd(receipt, err) t.tracer.OnTxEnd(receipt, err)
} }