From 59adc86680911a83dcccf5b23db299a370fc92f2 Mon Sep 17 00:00:00 2001 From: Patrick Strateman Date: Fri, 9 Sep 2016 18:53:23 -0700 Subject: [PATCH] Add CWallet::ListAccountCreditDebit Simple pass through for CWalletDB::ListAccountCreditDebit --- src/wallet/test/accounting_tests.cpp | 2 +- src/wallet/wallet.cpp | 5 +++++ src/wallet/wallet.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wallet/test/accounting_tests.cpp b/src/wallet/test/accounting_tests.cpp index a6cada46a..1863652fd 100644 --- a/src/wallet/test/accounting_tests.cpp +++ b/src/wallet/test/accounting_tests.cpp @@ -23,7 +23,7 @@ GetResults(CWalletDB& walletdb, std::map& results) results.clear(); BOOST_CHECK(walletdb.ReorderTransactions(pwalletMain) == DB_LOAD_OK); - walletdb.ListAccountCreditDebit("", aes); + pwalletMain->ListAccountCreditDebit("", aes); BOOST_FOREACH(CAccountingEntry& ae, aes) { results[ae.nOrderPos] = ae; diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 4c10ea0ed..7b5511167 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2501,6 +2501,11 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey, CCon return true; } +void CWallet::ListAccountCreditDebit(const std::string& strAccount, std::list& entries) { + CWalletDB walletdb(strWalletFile); + return walletdb.ListAccountCreditDebit(strAccount, entries); +} + bool CWallet::AddAccountingEntry(const CAccountingEntry& acentry, CWalletDB & pwalletdb) { if (!pwalletdb.WriteAccountingEntry_Backend(acentry)) diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 61aff6e45..160e097a8 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -775,6 +775,7 @@ public: std::string& strFailReason, const CCoinControl *coinControl = NULL, bool sign = true); bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey, CConnman* connman); + void ListAccountCreditDebit(const std::string& strAccount, std::list& entries); bool AddAccountingEntry(const CAccountingEntry&, CWalletDB & pwalletdb); static CFeeRate minTxFee;