Skip to content

Commit cb1274b

Browse files
committed
Merge branch 'gaslimit'
2 parents 98b733c + 30f2650 commit cb1274b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

backend/coins/eth/account.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -570,14 +570,10 @@ func (account *Account) newTx(
570570
}
571571
}
572572
}
573-
gasLimit := uint64(21000) // gas limit for standard ethereum transactions
574-
if account.coin.erc20Token != nil {
575-
n, err := account.coin.client.EstimateGas(context.TODO(), message)
576-
if err != nil {
577-
account.log.WithError(err).Error("Could not estimate the gas limit.")
578-
return nil, errp.WithStack(errors.ErrInvalidData)
579-
}
580-
gasLimit = n
573+
gasLimit, err := account.coin.client.EstimateGas(context.TODO(), message)
574+
if err != nil {
575+
account.log.WithError(err).Error("Could not estimate the gas limit.")
576+
return nil, errp.WithStack(errors.ErrInvalidData)
581577
}
582578

583579
fee := new(big.Int).Mul(new(big.Int).SetUint64(gasLimit), suggestedGasPrice)

0 commit comments

Comments
 (0)