Merge branch 'master' of github.com:tornadocash/tx-manager

This commit is contained in:
Roman Storm 2021-02-16 21:48:51 -08:00
commit af7c597af9
No known key found for this signature in database
GPG Key ID: 522F2A785F34E71F
1 changed files with 6 additions and 3 deletions

View File

@ -100,7 +100,7 @@ class Transaction {
try {
await this._prepare()
await this._send()
const receipt = this._waitForConfirmations()
const receipt = await this._waitForConfirmations()
// we could have bumped nonce during execution, so get the latest one + 1
this.manager._nonce = this.tx.nonce + 1
return receipt
@ -302,8 +302,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)) {