add MAX_GAS_PRICE

This commit is contained in:
Roman Storm 2021-02-16 21:48:44 -08:00
parent bc0b369095
commit 221dce3d73
No known key found for this signature in database
GPG Key ID: 522F2A785F34E71F

@ -129,7 +129,9 @@ class Transaction {
} }
} }
if (!this.tx.gasPrice) { if (!this.tx.gasPrice) {
this.tx.gasPrice = await this._getGasPrice('fast') const fastGasPrice = BigNumber.from(await this._getGasPrice('fast'))
const maxGasPrice = parseUnits(this.config.MAX_GAS_PRICE.toString(), 'gwei')
this.tx.gasPrice = min(fastGasPrice, maxGasPrice).toHexString()
} }
if (!this.manager._nonce) { if (!this.manager._nonce) {
this.manager._nonce = await this._getLastNonce() this.manager._nonce = await this._getLastNonce()