mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
core/types: remove duplicated check
This commit is contained in:
parent
a4ad86b280
commit
dc3292e403
1 changed files with 4 additions and 3 deletions
|
|
@ -355,6 +355,9 @@ func (tx *Transaction) GasTipCapIntCmp(other *big.Int) int {
|
|||
// Note: if the effective gasTipCap is negative, this method returns both error
|
||||
// the actual negative value, _and_ ErrGasFeeCapTooLow
|
||||
func (tx *Transaction) EffectiveGasTip(baseFee *big.Int) (*big.Int, error) {
|
||||
if baseFee == nil {
|
||||
return tx.inner.gasTipCap(), nil
|
||||
}
|
||||
out, err := tx.effectiveGasTip(baseFee)
|
||||
return new(big.Int).Set(out), err
|
||||
}
|
||||
|
|
@ -363,10 +366,8 @@ func (tx *Transaction) EffectiveGasTip(baseFee *big.Int) (*big.Int, error) {
|
|||
// Note: if the effective gasTipCap is negative, this method returns both error
|
||||
// the actual negative value, _and_ ErrGasFeeCapTooLow
|
||||
// Note: please copy the return value before modifying.
|
||||
// Note: assumes basefee to be non-nil.
|
||||
func (tx *Transaction) effectiveGasTip(baseFee *big.Int) (*big.Int, error) {
|
||||
if baseFee == nil {
|
||||
return tx.inner.gasTipCap(), nil
|
||||
}
|
||||
var err error
|
||||
gasFeeCap := tx.inner.gasFeeCap()
|
||||
if gasFeeCap.Cmp(baseFee) < 0 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue