From d2e678d7d220e2f430c2cb4bde559acee00c8c7c Mon Sep 17 00:00:00 2001 From: Patrick Strateman Date: Fri, 9 Sep 2016 19:21:44 -0700 Subject: Add CWallet::ReorderTransactions and use in accounting_tests.cpp --- src/wallet/test/accounting_tests.cpp | 2 +- src/wallet/wallet.cpp | 6 ++++++ src/wallet/wallet.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/wallet/test/accounting_tests.cpp b/src/wallet/test/accounting_tests.cpp index 1863652fd7..ad2f081b4e 100644 --- a/src/wallet/test/accounting_tests.cpp +++ b/src/wallet/test/accounting_tests.cpp @@ -22,7 +22,7 @@ GetResults(CWalletDB& walletdb, std::map& results) std::list aes; results.clear(); - BOOST_CHECK(walletdb.ReorderTransactions(pwalletMain) == DB_LOAD_OK); + BOOST_CHECK(pwalletMain->ReorderTransactions() == DB_LOAD_OK); pwalletMain->ListAccountCreditDebit("", aes); BOOST_FOREACH(CAccountingEntry& ae, aes) { diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 7b55111673..fe9671926a 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -649,6 +649,12 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase) return true; } +DBErrors CWallet::ReorderTransactions() +{ + CWalletDB walletdb(strWalletFile); + return walletdb.ReorderTransactions(this); +} + int64_t CWallet::IncOrderPosNext(CWalletDB *pwalletdb) { AssertLockHeld(cs_wallet); // nOrderPosNext diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 160e097a8e..2b978ba1ee 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -741,6 +741,7 @@ public: * @return next transaction order id */ int64_t IncOrderPosNext(CWalletDB *pwalletdb = NULL); + DBErrors ReorderTransactions(); bool AccountMove(std::string strFrom, std::string strTo, CAmount nAmount, std::string strComment = ""); bool GetAccountPubkey(CPubKey &pubKey, std::string strAccount, bool bForceNew = false); -- cgit v1.2.3