Skip to content

Commit 0d75e1b

Browse files
committed
fix: remove unnecessary retry on 404 response for BTC transactions
1 parent d5746a0 commit 0d75e1b

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

src/hooks/queries/transaction/utils.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ import {
1515
export function retryFactory(crypto: CryptoSymbol, transactionId: string) {
1616
const txFetchInfo = getTxFetchInfo(crypto)
1717

18-
return (failureCount: number): boolean => {
18+
return (failureCount: number, error: any): boolean => {
19+
// Don't retry BTC transactions on 404 (dust amount rejections)
20+
if (crypto === 'BTC' && error?.response?.status === 404) {
21+
return false
22+
}
23+
1924
const pendingTransaction = PendingTxStore.get(crypto)
2025
const isPendingTransaction = pendingTransaction?.id === transactionId
2126

src/store/modules/btc-base/btc-base-actions.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -233,18 +233,6 @@ function createActions(options) {
233233
} catch (error) {
234234
context.commit('transactions', [{ hash: signedTransaction.txid, status: 'REJECTED' }])
235235
PendingTxStore.remove(context.state.crypto)
236-
237-
if (admAddress) {
238-
context.commit(
239-
'chat/updateMessage',
240-
{
241-
partnerId: admAddress,
242-
id: signedTransaction.txid,
243-
status: 'REJECTED'
244-
},
245-
{ root: true }
246-
)
247-
}
248236
throw error
249237
}
250238
},

0 commit comments

Comments
 (0)