Part of the refactorings needed for basic multiwallet (#8694)
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: member
- MarcoFalke added the label Wallet on Sep 21, 2016
-
in src/wallet/wallet.cpp:None 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: memberRebased
luke-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 24539dc21fe5969c619f20
in src/init.cpp:None 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 here
MarcoFalke 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: memberDone
MarcoFalke commented at 12:19 PM on November 11, 2016: memberutACK 5394b39
in src/wallet/walletdb.cpp:None 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 a
const std::stringis 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:None 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:None 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 declare
CreateWalletFromFile()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: contributorutACK
sipa commented at 10:02 PM on January 3, 2017: memberutACK 5394b3940dec1fd35952d344e6373fb7115c5490
sipa merged this on Jan 3, 2017sipa closed this on Jan 3, 2017sipa 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, 2021LabelsMilestone
0.14.0
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: 2026-04-27 09:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me