fix replacement bug

This commit is contained in:
Alexey 2019-12-25 22:29:38 +03:00
parent 0dd0823423
commit 44909ef188
2 changed files with 3 additions and 2 deletions

@ -1,7 +1,7 @@
require('dotenv').config()
module.exports = {
version: '1.1',
version: '1.2',
netId: Number(process.env.NET_ID) || 42,
redisUrl: process.env.REDIS_URL,
rpcUrl: process.env.RPC_URL || 'https://kovan.infura.io/',

@ -153,7 +153,8 @@ async function sendTx(tx, done, retryAttempt = 1) {
console.log('error', e.message)
if(e.message === 'Returned error: Transaction gas price supplied is too low. There is another transaction with same nonce in the queue. Try increasing the gas price or incrementing the nonce.'
|| e.message === 'Returned error: Transaction nonce is too low. Try incrementing the nonce.'
|| e.message === 'Returned error: nonce too low') {
|| e.message === 'Returned error: nonce too low'
|| e.message === 'Returned error: replacement transaction underpriced') {
console.log('nonce too low, retrying')
if(retryAttempt <= 10) {
retryAttempt++