diff --git a/src/backend/file/gnc-account-xml-v2.c b/src/backend/file/gnc-account-xml-v2.c index e59edba44f..53cd0987eb 100644 --- a/src/backend/file/gnc-account-xml-v2.c +++ b/src/backend/file/gnc-account-xml-v2.c @@ -447,8 +447,7 @@ gnc_account_end_handler(gpointer data_for_children, if (type != ACCT_TYPE_ROOT) { root = gnc_book_get_root_account(book); if (root == NULL) { - gnc_commodity *com = xaccAccountGetCommodity(acc); - root = gnc_account_create_root(book, com); + root = gnc_account_create_root(book); } gnc_account_append_child(root, acc); } diff --git a/src/backend/file/io-gncxml-v2.c b/src/backend/file/io-gncxml-v2.c index 6b35ea6daf..5603ab6775 100644 --- a/src/backend/file/io-gncxml-v2.c +++ b/src/backend/file/io-gncxml-v2.c @@ -191,8 +191,7 @@ add_account_local(sixtp_gdv2 *data, Account *act) if (parent == NULL) { root = gnc_book_get_root_account(data->book); if (root == NULL) { - gnc_commodity *com = xaccAccountGetCommodity(act); - root = gnc_account_create_root(data->book, com); + root = gnc_account_create_root(data->book); /* Leave the account in the edit state. It will be committed * at the end of reading all the transactions. */ xaccAccountBeginEdit(root); diff --git a/src/engine/Account.c b/src/engine/Account.c index 7389ae56fe..639c0618de 100644 --- a/src/engine/Account.c +++ b/src/engine/Account.c @@ -219,15 +219,13 @@ xaccMallocAccount (QofBook *book) } Account * -gnc_account_create_root (QofBook *book, gnc_commodity *com) +gnc_account_create_root (QofBook *book) { Account *root; root = xaccMallocAccount(book); xaccAccountBeginEdit(root); root->type = ACCT_TYPE_ROOT; - root->commodity = com; - root->commodity_scu = gnc_commodity_get_fraction(com); xaccAccountCommitEdit(root); gnc_book_set_root_account(book, root); return root; diff --git a/src/engine/Account.h b/src/engine/Account.h index fdf02c5826..9f35efd1bb 100644 --- a/src/engine/Account.h +++ b/src/engine/Account.h @@ -148,7 +148,7 @@ typedef enum Account * xaccMallocAccount (QofBook *book); /** Create a new root level account. */ -Account * gnc_account_create_root (QofBook *book, gnc_commodity *com); +Account * gnc_account_create_root (QofBook *book); /** The xaccCloneAccount() does the same as xaccCloneAccountSimple(), * except that it also also places a pair of GUID-pointers diff --git a/src/engine/Scrub.c b/src/engine/Scrub.c index f4637313b9..9d18612bea 100644 --- a/src/engine/Scrub.c +++ b/src/engine/Scrub.c @@ -666,6 +666,7 @@ xaccAccountScrubCommodity (Account *account) gnc_commodity *commodity; if (!account) return; + if (xaccAccountGetType(account) == ACCT_TYPE_ROOT) return; commodity = xaccAccountGetCommodity (account); if (commodity) return;