mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
tracers/callflat: fix the nil receipt crash
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
c8dfa31422
commit
0099e5e2b8
1 changed files with 11 additions and 6 deletions
|
|
@ -224,13 +224,18 @@ func (t *flatCallTracer) OnTxEnd(receipt *types.Receipt, err error) {
|
|||
if t.interrupt.Load() {
|
||||
return
|
||||
}
|
||||
// Always set context with receipt data.
|
||||
if receipt != nil {
|
||||
// Reset context with receipt data.
|
||||
t.ctx = &tracers.Context{
|
||||
BlockHash: receipt.BlockHash,
|
||||
BlockNumber: receipt.BlockNumber,
|
||||
TxHash: receipt.TxHash,
|
||||
TxIndex: int(receipt.TransactionIndex),
|
||||
}
|
||||
} else {
|
||||
// Set to nil if receipt is nil.
|
||||
t.ctx = nil
|
||||
}
|
||||
t.tracer.OnTxEnd(receipt, err)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue