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,12 +224,17 @@ func (t *flatCallTracer) OnTxEnd(receipt *types.Receipt, err error) {
|
||||||
if t.interrupt.Load() {
|
if t.interrupt.Load() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Always set context with receipt data.
|
if receipt != nil {
|
||||||
t.ctx = &tracers.Context{
|
// Reset context with receipt data.
|
||||||
BlockHash: receipt.BlockHash,
|
t.ctx = &tracers.Context{
|
||||||
BlockNumber: receipt.BlockNumber,
|
BlockHash: receipt.BlockHash,
|
||||||
TxHash: receipt.TxHash,
|
BlockNumber: receipt.BlockNumber,
|
||||||
TxIndex: int(receipt.TransactionIndex),
|
TxHash: receipt.TxHash,
|
||||||
|
TxIndex: int(receipt.TransactionIndex),
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Set to nil if receipt is nil.
|
||||||
|
t.ctx = nil
|
||||||
}
|
}
|
||||||
t.tracer.OnTxEnd(receipt, err)
|
t.tracer.OnTxEnd(receipt, err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue