How to remove all txns from an Account?

Charles Day cedayiv at
Tue Apr 15 12:33:18 EDT 2008

What is the proper way to destroy all transactions that involve a particular

I tried using xaccAccountTreeForEachTransaction(), but that uses
xaccAccountStagedTransactionTraversal() which has a limitation in that it
assumes that no splits are being removed from the account. Is this
limitation intentional?

So for example, the following code doesn't work and actually can cause

/* Remove all the transactions in this account and its descendants. */
xaccAccountTreeForEachTransaction(acc, remove_transaction_cb, NULL);

---where remove_transaction_cb is defined as the following---

static gint
remove_transaction_cb(Transaction * trans, void * data)
  /* Destroy the transaction. */

  return 0;


More information about the gnucash-devel mailing list