[import-backend.cpp] gnc_import_exists_online_id shouldn't destroy transaction

Because gnc_import_exists_online_id is documented to only check that
the online_id already exists. It is more appropriate for its caller to
destroy the transaction.
pull/1725/head
Christopher Lam 3 years ago
parent 73a78f7072
commit 52b7bdc7e9

@ -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;
}

@ -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);

Loading…
Cancel
Save