From ab7fab365f98c80f62ecb34debca11b84d8befe8 Mon Sep 17 00:00:00 2001 From: Mikhail Mikheev Date: Mon, 6 Jul 2020 14:41:55 +0400 Subject: [PATCH] check if there as a pending transaction before marking transaction as a cancellation one --- .../fetchTransactions/loadOutgoingTransactions.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/routes/safe/store/actions/transactions/fetchTransactions/loadOutgoingTransactions.ts b/src/routes/safe/store/actions/transactions/fetchTransactions/loadOutgoingTransactions.ts index 9b2f8000..6c0f2736 100644 --- a/src/routes/safe/store/actions/transactions/fetchTransactions/loadOutgoingTransactions.ts +++ b/src/routes/safe/store/actions/transactions/fetchTransactions/loadOutgoingTransactions.ts @@ -79,7 +79,10 @@ export type BatchProcessTxsProps = OutgoingTxs & { const extractCancelAndOutgoingTxs = (safeAddress: string, outgoingTxs: TxServiceModel[]): OutgoingTxs => { return outgoingTxs.reduce( (acc, transaction) => { - if (isCancelTransaction(transaction, safeAddress)) { + if ( + isCancelTransaction(transaction, safeAddress) && + outgoingTxs.find((tx) => tx.nonce === transaction.nonce && !isCancelTransaction(tx, safeAddress)) + ) { if (!isNaN(Number(transaction.nonce))) { acc.cancellationTxs[transaction.nonce] = transaction }