diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -875,7 +875,7 @@ // Old wallets didn't have any defined order for transactions. Probably a // bad idea to change the output of this. - // First: get all CWalletTx and CAccountingEntry into a sorted-by-time + // First: get all CWalletTx into a sorted-by-time // multimap. TxItems txByTime; @@ -885,12 +885,6 @@ std::make_pair(wtx->nTimeReceived, TxPair(wtx, nullptr))); } - std::list acentries; - batch.ListAccountCreditDebit("", acentries); - for (CAccountingEntry &entry : acentries) { - txByTime.insert(std::make_pair(entry.nTime, TxPair(nullptr, &entry))); - } - nOrderPosNext = 0; std::vector nOrderPosOffsets; for (TxItems::iterator it = txByTime.begin(); it != txByTime.end(); ++it) { @@ -907,9 +901,6 @@ if (!batch.WriteTx(*pwtx)) { return DBErrors::LOAD_FAIL; } - } else if (!batch.WriteAccountingEntry(pacentry->nEntryNo, - *pacentry)) { - return DBErrors::LOAD_FAIL; } } else { int64_t nOrderPosOff = 0; @@ -931,9 +922,6 @@ if (!batch.WriteTx(*pwtx)) { return DBErrors::LOAD_FAIL; } - } else if (!batch.WriteAccountingEntry(pacentry->nEntryNo, - *pacentry)) { - return DBErrors::LOAD_FAIL; } } } diff --git a/src/wallet/walletdb.h b/src/wallet/walletdb.h --- a/src/wallet/walletdb.h +++ b/src/wallet/walletdb.h @@ -195,11 +195,6 @@ bool WriteMinVersion(int nVersion); - /// This writes directly to the database, and will not update the CWallet's - /// cached accounting entries! - /// Use wallet.AddAccountingEntry instead, to write *and* update its caches. - bool WriteAccountingEntry(const uint64_t nAccEntryNum, - const CAccountingEntry &acentry); bool ReadAccount(const std::string &strAccount, CAccount &account); bool WriteAccount(const std::string &strAccount, const CAccount &account); bool EraseAccount(const std::string &strAccount); diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -182,14 +182,6 @@ return EraseIC(std::make_pair(std::string("acc"), strAccount)); } -bool WalletBatch::WriteAccountingEntry(const uint64_t nAccEntryNum, - const CAccountingEntry &acentry) { - return WriteIC( - std::make_pair(std::string("acentry"), - std::make_pair(acentry.strAccount, nAccEntryNum)), - acentry); -} - void WalletBatch::ListAccountCreditDebit(const std::string &strAccount, std::list &entries) { bool fAllAccounts = (strAccount == "*");