This removes the CWalletDB references in account_tests.cpp by adding passthrough functions in CWallet
[Wallet] Remove last external reference to CWalletDB #8696
pull pstratem wants to merge 4 commits into bitcoin:master from pstratem:2016-09-09-cwallet-listaccountcreditdebit changing 3 files +37 −18-
pstratem commented at 2:27 AM on September 10, 2016: contributor
-
luke-jr commented at 3:07 AM on September 10, 2016: member
ThreadFlushWalletDB is started from init still, no?
-
pstratem commented at 3:10 AM on September 10, 2016: contributor
@luke-jr yes but that doesn't use CWalletDB and handles something having the database open already just fine.
The goal here is to cache the CWalletDB across nested CWallet calls to avoid performance issues. (Similar to what the initial wallet encryption logic does).
- fanquake added the label Wallet on Sep 10, 2016
-
MarcoFalke commented at 11:32 AM on September 11, 2016: member
utACK 461a760
-
jonasschnelli commented at 9:37 AM on September 12, 2016: contributor
utACK 461a7600664fe771964fc0bf153004c087bd8004
-
in src/wallet/wallet.h:None in 461a760066 outdated
737 | @@ -738,6 +738,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface 738 | * @return next transaction order id 739 | */ 740 | int64_t IncOrderPosNext(CWalletDB *pwalletdb = NULL); 741 | + DBErrors ReorderTransactions();
TheBlueMatt commented at 1:55 PM on September 13, 2016:Would be kind of nice to not expose DBErrors further from wallet, though I would still call this a strict improvement.
pstratem commented at 12:38 PM on September 15, 2016:DBErrors is already exposed in CWallet::LoadWallet I'll probably change that later
in src/wallet/wallet.cpp:None in 461a760066 outdated
691 | @@ -686,7 +692,7 @@ bool CWallet::AccountMove(std::string strFrom, std::string strTo, CAmount nAmoun 692 | credit.nTime = nNow; 693 | credit.strOtherAccount = strFrom; 694 | credit.strComment = strComment; 695 | - AddAccountingEntry(credit, walletdb); 696 | + AddAccountingEntry(credit);
TheBlueMatt commented at 2:04 PM on September 13, 2016:Does this lose atomicity? Could duplicate the function to add a wrapper which does not require the walletdb pointer?
pstratem commented at 4:02 PM on September 15, 2016:I've made AccountMove atomic again by overloading AddAccountingEntry
pstratem force-pushed on Sep 15, 201659adc86680Add CWallet::ListAccountCreditDebit
Simple pass through for CWalletDB::ListAccountCreditDebit
Add CWallet::ReorderTransactions and use in accounting_tests.cpp d2e678d7d2pstratem force-pushed on Sep 15, 2016Remove pwalletdb parameter from CWallet::AddAccountingEntry 02e2a81536Remove last reference to CWalletDB from accounting_tests.cpp 2ca6b9df1dpstratem force-pushed on Sep 15, 2016in src/wallet/wallet.h:None in 2ca6b9df1d
775 | @@ -775,7 +776,9 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface 776 | std::string& strFailReason, const CCoinControl *coinControl = NULL, bool sign = true); 777 | bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey, CConnman* connman); 778 | 779 | - bool AddAccountingEntry(const CAccountingEntry&, CWalletDB & pwalletdb); 780 | + void ListAccountCreditDebit(const std::string& strAccount, std::list<CAccountingEntry>& entries); 781 | + bool AddAccountingEntry(const CAccountingEntry&); 782 | + bool AddAccountingEntry(const CAccountingEntry&, CWalletDB *pwalletdb);
laanwj commented at 10:05 AM on September 20, 2016:Can this one be private?
pstratem commented at 10:07 AM on September 20, 2016:Maybe, I'm going to go through all of the API calls and make things which can be private private as a sweep.
I'd rather fix this then.
laanwj commented at 10:46 AM on September 20, 2016:OK, fair enough
laanwj approvedlaanwj merged this on Sep 20, 2016laanwj closed this on Sep 20, 2016laanwj referenced this in commit a1f8d3ed95 on Sep 20, 2016laanwj commented at 10:47 AM on September 20, 2016: memberutACK 2ca6b9d
codablock referenced this in commit 2e90511bec on Sep 19, 2017codablock referenced this in commit 630c699f00 on Jan 11, 2018andvgal referenced this in commit 7a57516785 on Jan 6, 2019zkbot referenced this in commit 5b194067ea on Aug 12, 2021MarcoFalke locked this on Sep 8, 2021Labels
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-19 00:15 UTC
More mirrored repositories can be found on mirror.b10c.me