From 8d4bab7fc2ef85d7c9604ab753e0a475495d107e Mon Sep 17 00:00:00 2001 From: poma Date: Wed, 17 Feb 2021 08:40:14 +0300 Subject: [PATCH] handle bump gas price error --- src/Transaction.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Transaction.js b/src/Transaction.js index 5822108..cf2f742 100644 --- a/src/Transaction.js +++ b/src/Transaction.js @@ -300,8 +300,11 @@ class Transaction { console.log( `Gas price ${formatUnits(this.tx.gasPrice, 'gwei')} gwei is too low, increasing and retrying`, ) - this._increaseGasPrice() - return this._send() + if (this._increaseGasPrice()) { + return this._send() + } else { + throw new Error('Already at max gas price, but still not enough to submit the transaction') + } } if (this._hasError(message, sameTxErrors)) {