Fix resend of stuck pending transactions (#514)
This commit is contained in:
parent
894134ba26
commit
626f9376b2
@ -173,15 +173,18 @@ async function main({ msg, ackMsg, nackMsg, channel, scheduleForRetry, scheduleT
|
||||
`Tx Failed for event Tx ${job.transactionReference}.`,
|
||||
e.message
|
||||
)
|
||||
if (!e.message.toLowerCase().includes('transaction with the same hash was already imported')) {
|
||||
if (isResend) {
|
||||
resendJobs.push(job)
|
||||
} else {
|
||||
failedTx.push(job)
|
||||
}
|
||||
|
||||
const message = e.message.toLowerCase()
|
||||
if (isResend || message.includes('transaction with the same hash was already imported')) {
|
||||
resendJobs.push(job)
|
||||
} else {
|
||||
// if initial transaction sending has failed not due to the same hash error
|
||||
// send it to the failed tx queue
|
||||
// this will result in the sooner resend attempt than if using resendJobs
|
||||
failedTx.push(job)
|
||||
}
|
||||
|
||||
if (e.message.toLowerCase().includes('insufficient funds')) {
|
||||
if (message.includes('insufficient funds')) {
|
||||
insufficientFunds = true
|
||||
const currentBalance = await web3Instance.eth.getBalance(ORACLE_VALIDATOR_ADDRESS)
|
||||
minimumBalance = gasLimit.multipliedBy(gasPrice)
|
||||
|
Loading…
Reference in New Issue
Block a user