Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Wallet refactoring leading up to multiwallet #8776
Conversation
MarcoFalke
added
the
Wallet
label
Sep 21, 2016
| +{ | ||
| + std::string walletFile = GetArg("-wallet", DEFAULT_WALLET_DAT); | ||
| + | ||
| + CWallet * const pwallet = CreateWalletFromFile(walletFile); |
|
Needs rebase. |
|
Rebased |
added a commit
to bitcoinknots/bitcoin
that referenced
this pull request
Oct 20, 2016
added a commit
to bitcoinknots/bitcoin
that referenced
this pull request
Oct 20, 2016
|
utACK 24539dc |
| @@ -1527,7 +1527,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) | ||
| #ifdef ENABLE_WALLET | ||
| if (pwalletMain) { | ||
| // Run a thread to flush wallet periodically | ||
| - threadGroup.create_thread(boost::bind(&ThreadFlushWalletDB, boost::ref(pwalletMain->strWalletFile))); | ||
| + threadGroup.create_thread(ThreadFlushWalletDB); |
MarcoFalke
added this to the 0.14.0 milestone
Nov 7, 2016
|
@luke-jr Mind to solve the merge conflict? Also, assigned 0.14 milestone, I think this is relatively trivial/uncontroversial refactoring. |
luke-jr
added some commits
Sep 9, 2016
|
Done |
|
utACK 5394b39 |
| @@ -810,6 +810,7 @@ void ThreadFlushWalletDB(const string& strFile) | ||
| if (nRefCount == 0) | ||
| { | ||
| boost::this_thread::interruption_point(); | ||
| + const std::string& strFile = pwalletMain->strWalletFile; |
jonasschnelli
Nov 11, 2016
Member
In theory, this should only be done when holding cs_wallet. I guess changing CWallet::strWalletFile to a const std::string is not possible with the current concept of setting the filename in a instance method.
But maybe I'm wrong.
luke-jr
Nov 11, 2016
Member
wallet.h says "This lock protects all the fields added by CWallet except for: ... strWalletFile (immutable after instantiation)"
| @@ -914,6 +917,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface | ||
| static std::string GetWalletHelpString(bool showDebug); | ||
| /* Initializes the wallet, returns a new CWallet instance or a null pointer in case of an error */ |
jonasschnelli
Nov 11, 2016
Member
Heh. This (unchanged) comment was wrong before and correct after this PR. :)
| @@ -914,6 +917,7 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface | ||
| static std::string GetWalletHelpString(bool showDebug); | ||
| /* Initializes the wallet, returns a new CWallet instance or a null pointer in case of an error */ | ||
| + static CWallet* CreateWalletFromFile(const std::string walletFile); |
jonasschnelli
Nov 11, 2016
Member
Maybe declare CreateWalletFromFile() private to avoid layer confusion?
|
@jonasschnelli Are your comments addressed by the feedback? |
|
@jonasschnelli Are your comments addressed by the feedback? Yes. |
jonasschnelli
referenced this pull request
Nov 28, 2016
Merged
Make nWalletDBUpdated atomic to avoid a potential race. #9227
|
Code Review ACK. |
|
utACK |
|
utACK 5394b39 |
luke-jr commentedSep 21, 2016
Part of the refactorings needed for basic multiwallet (#8694)