Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/store/modules/btc-base/btc-base-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from '@/lib/pending-transactions'
import { storeCryptoAddress, validateStoredCryptoAddresses } from '@/lib/store-crypto-address'
import shouldUpdate from '@/store/utils/coinUpdatesGuard'
import { useFinalTransactions } from '@/stores/final-transactions'

const DEFAULT_CUSTOM_ACTIONS = () => ({})
let interval
Expand Down Expand Up @@ -223,7 +224,16 @@ function createActions(options) {

return hash
} catch (error) {
context.commit('transactions', [{ hash: signedTransaction.txid, status: 'REJECTED' }])
const transactionData = { hash: signedTransaction.txid, status: 'REJECTED' }
if (
error.response?.data?.includes?.('dust') ||
error.response?.data?.error?.message?.includes?.('dust')
) {
transactionData.isDust = true
}
context.commit('transactions', [transactionData])
const { addTransaction } = useFinalTransactions()
addTransaction(signedTransaction.txid, 'REJECTED')
PendingTxStore.remove(context.state.crypto)
throw error
}
Expand Down
5 changes: 3 additions & 2 deletions src/views/Transactions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,16 @@ const isOlderLoading = computed(() => store.getters[`${cryptoModule.value}/areOl
const isLoginViaPassword = computed(() => store.getters['options/isLoginViaPassword'])
const isIDBReady = computed(() => store.state.IDBReady)
const transactions = computed(() => {
const transactions: (CoinTransaction & { data?: string })[] =
const transactions: (CoinTransaction & { data?: string; isDust: boolean })[] =
store.getters[`${cryptoModule.value}/sortedTransactions`]

const address = store.state[props.crypto.toLowerCase()].address
return transactions.filter((tx) => {
// Filter invalid "fake" transactions (from chat rich message)
return (
Object.prototype.hasOwnProperty.call(tx, 'amount') &&
(isStringEqualCI(tx.recipientId, address) || isStringEqualCI(tx.senderId, address))
(isStringEqualCI(tx.recipientId, address) || isStringEqualCI(tx.senderId, address)) &&
!tx.isDust
)
})
})
Expand Down