Wallet refactoring leading up to multiwallet #8776
pull luke-jr wants to merge 2 commits into bitcoin:master from luke-jr:multiwallet_prefactor_wallet changing 4 files +65 −31-
luke-jr commented at 10:01 am on September 21, 2016: memberPart of the refactorings needed for basic multiwallet (#8694)
-
MarcoFalke added the label Wallet on Sep 21, 2016
-
in src/wallet/wallet.cpp: in 682936cd8f outdated
3477+ 3478+bool CWallet::InitLoadWallet() 3479+{ 3480+ std::string walletFile = GetArg("-wallet", DEFAULT_WALLET_DAT); 3481+ 3482+ CWallet * const pwallet = CreateWalletFromFile(walletFile);
jonasschnelli commented at 6:53 am on September 22, 2016:nit:const CWallet *pwallet =
jonasschnelli approvedjonasschnelli commented at 6:56 am on September 22, 2016: contributorjonasschnelli commented at 6:56 am on September 22, 2016: contributorNeeds rebase.luke-jr commented at 8:25 am on September 22, 2016: memberRebasedluke-jr force-pushed on Sep 22, 2016luke-jr referenced this in commit 52f65d5971 on Oct 20, 2016luke-jr referenced this in commit d2e63293ef on Oct 20, 2016MarcoFalke commented at 5:45 pm on October 22, 2016: memberutACK 24539dc21fe5969c619f20in src/init.cpp: in 24539dc21f outdated
1526@@ -1527,7 +1527,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) 1527 #ifdef ENABLE_WALLET 1528 if (pwalletMain) { 1529 // Run a thread to flush wallet periodically 1530- threadGroup.create_thread(boost::bind(&ThreadFlushWalletDB, boost::ref(pwalletMain->strWalletFile))); 1531+ threadGroup.create_thread(ThreadFlushWalletDB);
MarcoFalke commented at 9:35 pm on November 2, 2016:Needs merge conflict solved hereMarcoFalke added this to the milestone 0.14.0 on Nov 7, 2016MarcoFalke commented at 9:49 am on November 7, 2016: member@luke-jr Mind to solve the merge conflict?
Also, assigned 0.14 milestone, I think this is relatively trivial/uncontroversial refactoring.
Wallet: Let the interval-flushing thread figure out the filename fb0c934d1bWallet: Split main logic from InitLoadWallet into CreateWalletFromFile 5394b3940dluke-jr force-pushed on Nov 11, 2016luke-jr commented at 11:46 am on November 11, 2016: memberDoneMarcoFalke commented at 12:19 pm on November 11, 2016: memberutACK 5394b39in src/wallet/walletdb.cpp: in 5394b3940d
809@@ -810,6 +810,7 @@ void ThreadFlushWalletDB(const string& strFile) 810 if (nRefCount == 0) 811 { 812 boost::this_thread::interruption_point(); 813+ const std::string& strFile = pwalletMain->strWalletFile;
jonasschnelli commented at 12:33 pm on November 11, 2016:In theory, this should only be done when holding cs_wallet. I guess changing CWallet::strWalletFile to aconst std::string
is not possible with the current concept of setting the filename in a instance method. But maybe I’m wrong.
luke-jr commented at 1:12 pm on November 11, 2016:wallet.h says “This lock protects all the fields added by CWallet except for: … strWalletFile (immutable after instantiation)”in src/wallet/wallet.h: in 5394b3940d
916@@ -914,6 +917,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface 917 static std::string GetWalletHelpString(bool showDebug); 918 919 /* Initializes the wallet, returns a new CWallet instance or a null pointer in case of an error */
jonasschnelli commented at 12:36 pm on November 11, 2016:Heh. This (unchanged) comment was wrong before and correct after this PR. :)in src/wallet/wallet.h: in 5394b3940d
916@@ -914,6 +917,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface 917 static std::string GetWalletHelpString(bool showDebug); 918 919 /* Initializes the wallet, returns a new CWallet instance or a null pointer in case of an error */ 920+ static CWallet* CreateWalletFromFile(const std::string walletFile);
jonasschnelli commented at 12:36 pm on November 11, 2016:Maybe declareCreateWalletFromFile()
private to avoid layer confusion?
luke-jr commented at 1:13 pm on November 11, 2016:It’s not really intended to be private…MarcoFalke commented at 11:37 pm on November 17, 2016: member@jonasschnelli Are your comments addressed by the feedback?jonasschnelli commented at 2:33 pm on November 21, 2016: contributor@jonasschnelli Are your comments addressed by the feedback?
Yes. re-utACK 5394b3940dec1fd35952d344e6373fb7115c5490
NicolasDorier commented at 9:44 am on December 28, 2016: contributorCode Review ACK.gmaxwell commented at 5:47 pm on January 3, 2017: contributorutACKsipa commented at 10:02 pm on January 3, 2017: memberutACK 5394b3940dec1fd35952d344e6373fb7115c5490sipa merged this on Jan 3, 2017sipa closed this on Jan 3, 2017
sipa referenced this in commit 2a524b8e8f on Jan 3, 2017codablock referenced this in commit da209546df on Jan 18, 2018andvgal referenced this in commit 22790ae3e0 on Jan 6, 2019CryptoCentric referenced this in commit 1103008ee9 on Feb 26, 2019random-zebra referenced this in commit e89e20eca1 on Aug 25, 2020MarcoFalke locked this on Sep 8, 2021
github-metadata-mirror
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: 2025-01-22 06:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me