Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[Wallet] move "load wallet phase" to CWallet #7577
referenced this pull request
Feb 26, 2016
Concept ACK, this is a nice step toward factoring out the wallet code (as well as a step towards being able to load multiple wallets).
I do think the return condition is a bit messy, e.g. using both a NULL return value as well as a non-empty errorString as an error condition:
+ if (!pwalletMain) + return false; ... + if (!errorString.empty()) + return InitError(errorString);
Ideally, InitLoadWallet would always return NULL if an error happened, and always fill errorString.
From the initial work I've done on updating some of Jonas's other wallet patches, this is familiar and I agree it can be confusing, especially in some of the more complicated changes where wallet code calls some other wallet code with its own error handling. The intention is to end up with at least one (and preferably only one) error message in the log if something goes wrong. Worst case scenario if we screw up is that the program just shuts down without an error being reported.