diff --git a/src/modules/transaction/reducer.ts b/src/modules/transaction/reducer.ts index 96f2fe54..7640e1ef 100644 --- a/src/modules/transaction/reducer.ts +++ b/src/modules/transaction/reducer.ts @@ -158,7 +158,7 @@ export function transactionReducer( action.payload.hash === transaction.hash ? { ...transaction, - status: TransactionStatus.REVERTED, + status: TransactionStatus.REPLACED, replacedBy: action.payload.replaceBy } : transaction diff --git a/src/modules/transaction/sagas.ts b/src/modules/transaction/sagas.ts index 2487af70..db455d38 100644 --- a/src/modules/transaction/sagas.ts +++ b/src/modules/transaction/sagas.ts @@ -308,12 +308,18 @@ function* handleWatchRevertedTransaction( do { yield delay(TRANSACTION_FETCH_DELAY) - const tx: AnyTransaction | null = yield call(() => + const txInNetwork: AnyTransaction | null = yield call(() => getTransactionFromNetwork(hash) ) - if (tx != null && tx.status === TransactionStatus.CONFIRMED) { + if ( + txInNetwork != null && + txInNetwork.status === TransactionStatus.CONFIRMED + ) { yield put(fixRevertedTransaction(hash)) return + } else if (txInNetwork == null && txInState.nonce) { + yield put(replaceTransactionRequest(hash, txInState.nonce)) + return } } while (!isExpired(txInState, REVERTED_TRANSACTION_THRESHOLD)) }