Skip to content

Commit b7fd01a

Browse files
committed
[wallet] Remove ListAccountCreditDebit()
Function no longer used.
1 parent a544ab2 commit b7fd01a

File tree

2 files changed

+0
-45
lines changed

2 files changed

+0
-45
lines changed

src/wallet/walletdb.cpp

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -166,49 +166,6 @@ bool WalletBatch::EraseAccount(const std::string& strAccount)
166166
return EraseIC(std::make_pair(std::string("acc"), strAccount));
167167
}
168168

169-
void WalletBatch::ListAccountCreditDebit(const std::string& strAccount, std::list<CAccountingEntry>& entries)
170-
{
171-
bool fAllAccounts = (strAccount == "*");
172-
173-
Dbc* pcursor = m_batch.GetCursor();
174-
if (!pcursor)
175-
throw std::runtime_error(std::string(__func__) + ": cannot create DB cursor");
176-
bool setRange = true;
177-
while (true)
178-
{
179-
// Read next record
180-
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
181-
if (setRange)
182-
ssKey << std::make_pair(std::string("acentry"), std::make_pair((fAllAccounts ? std::string("") : strAccount), uint64_t(0)));
183-
CDataStream ssValue(SER_DISK, CLIENT_VERSION);
184-
int ret = m_batch.ReadAtCursor(pcursor, ssKey, ssValue, setRange);
185-
setRange = false;
186-
if (ret == DB_NOTFOUND)
187-
break;
188-
else if (ret != 0)
189-
{
190-
pcursor->close();
191-
throw std::runtime_error(std::string(__func__) + ": error scanning DB");
192-
}
193-
194-
// Unserialize
195-
std::string strType;
196-
ssKey >> strType;
197-
if (strType != "acentry")
198-
break;
199-
CAccountingEntry acentry;
200-
ssKey >> acentry.strAccount;
201-
if (!fAllAccounts && acentry.strAccount != strAccount)
202-
break;
203-
204-
ssValue >> acentry;
205-
ssKey >> acentry.nEntryNo;
206-
entries.push_back(acentry);
207-
}
208-
209-
pcursor->close();
210-
}
211-
212169
class CWalletScanState {
213170
public:
214171
unsigned int nKeys;

src/wallet/walletdb.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,6 @@ class WalletBatch
208208
/// Erase destination data tuple from wallet database
209209
bool EraseDestData(const std::string &address, const std::string &key);
210210

211-
void ListAccountCreditDebit(const std::string& strAccount, std::list<CAccountingEntry>& acentries);
212-
213211
DBErrors LoadWallet(CWallet* pwallet);
214212
DBErrors FindWalletTx(std::vector<uint256>& vTxHash, std::vector<CWalletTx>& vWtx);
215213
DBErrors ZapWalletTx(std::vector<CWalletTx>& vWtx);

0 commit comments

Comments
 (0)