mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
fix GetTransactionReceipt crash when BaseFee is missing (#224)
This commit is contained in:
parent
310c870c6a
commit
3fcd77955e
1 changed files with 7 additions and 1 deletions
|
|
@ -1588,7 +1588,13 @@ func (s *PublicTransactionPoolAPI) GetTransactionReceipt(ctx context.Context, ha
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
gasPrice := new(big.Int).Add(header.BaseFee, tx.EffectiveGasTipValue(header.BaseFee))
|
|
||||||
|
baseFee := header.BaseFee
|
||||||
|
if baseFee == nil {
|
||||||
|
baseFee = big.NewInt(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
gasPrice := new(big.Int).Add(baseFee, tx.EffectiveGasTipValue(header.BaseFee))
|
||||||
fields["effectiveGasPrice"] = hexutil.Uint64(gasPrice.Uint64())
|
fields["effectiveGasPrice"] = hexutil.Uint64(gasPrice.Uint64())
|
||||||
}
|
}
|
||||||
// Assign receipt status or post state.
|
// Assign receipt status or post state.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue