From 809ee795927f0b9110a5b6e83845f42e3394451d Mon Sep 17 00:00:00 2001 From: gavinandresen Date: Thu, 16 Dec 2010 01:06:03 +0000 Subject: New RPC command: listaccounts. New RPC setting -rpctimeout. And listtransactions '*' git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@203 1a98c847-1fd6-4fd8-948a-caf3550aa51b --- db.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'db.cpp') diff --git a/db.cpp b/db.cpp index 8f02fffaf..38b1d6e57 100644 --- a/db.cpp +++ b/db.cpp @@ -592,9 +592,9 @@ bool CWalletDB::WriteAccount(const string& strAccount, const CAccount& account) return Write(make_pair(string("acc"), strAccount), account); } -bool CWalletDB::WriteAccountingEntry(const string& strAccount, const CAccountingEntry& acentry) +bool CWalletDB::WriteAccountingEntry(const CAccountingEntry& acentry) { - return Write(make_tuple(string("acentry"), strAccount, ++nAccountingEntryNumber), acentry); + return Write(make_tuple(string("acentry"), acentry.strAccount, ++nAccountingEntryNumber), acentry); } int64 CWalletDB::GetAccountCreditDebit(const string& strAccount) @@ -613,6 +613,8 @@ void CWalletDB::ListAccountCreditDebit(const string& strAccount, list> strType; if (strType != "acentry") break; - string strAccountName; - ssKey >> strAccountName; - if (strAccountName != strAccount) + CAccountingEntry acentry; + ssKey >> acentry.strAccount; + if (!fAllAccounts && acentry.strAccount != strAccount) break; - CAccountingEntry acentry; ssValue >> acentry; entries.push_back(acentry); } @@ -652,6 +653,7 @@ void CWalletDB::ListAccountCreditDebit(const string& strAccount, listclose(); } + bool CWalletDB::LoadWallet() { vchDefaultKey.clear(); -- cgit v1.2.3