diff --git a/gnucash/import-export/import-backend.cpp b/gnucash/import-export/import-backend.cpp index 7943f8603f..7fe944b25a 100644 --- a/gnucash/import-export/import-backend.cpp +++ b/gnucash/import-export/import-backend.cpp @@ -1033,15 +1033,6 @@ gboolean gnc_import_exists_online_id (Transaction *trans, GHashTable* acct_id_ha } auto online_id_exists = g_hash_table_contains (online_id_hash, source_online_id); - - /* If it does, abort the process for this transaction, since it is - already in the system. */ - if (online_id_exists) - { - DEBUG("%s", "Transaction with same online ID exists, destroying current transaction"); - xaccTransDestroy(trans); - xaccTransCommitEdit(trans); - } g_free (source_online_id); return online_id_exists; } diff --git a/gnucash/import-export/import-main-matcher.cpp b/gnucash/import-export/import-main-matcher.cpp index 3716bbd492..36d1cad898 100644 --- a/gnucash/import-export/import-main-matcher.cpp +++ b/gnucash/import-export/import-main-matcher.cpp @@ -2225,7 +2225,14 @@ gnc_gen_trans_list_add_trans_internal (GNCImportMainMatcher *gui, Transaction *t g_assert (trans); if (gnc_import_exists_online_id (trans, gui->acct_id_hash)) + { + /* If it does, abort the process for this transaction, since + it is already in the system. */ + DEBUG("%s", "Transaction with same online ID exists, destroying current transaction"); + xaccTransDestroy(trans); + xaccTransCommitEdit(trans); return; + } Split *split = xaccTransGetSplit (trans, 0); Account *acc = xaccSplitGetAccount (split);