Skip to content

Commit

Permalink
Better error reporting for the !ENABLE_WALLET && ENABLE_MINING case.
Browse files Browse the repository at this point in the history
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
  • Loading branch information
daira committed Feb 9, 2017
1 parent f49bcdf commit 9bba9b3
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1468,8 +1468,18 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
#endif // !ENABLE_WALLET

#ifdef ENABLE_MINING
#ifndef ENABLE_WALLET
auto mineToLocalWallet = GetBoolArg("-minetolocalwallet", false);
if (mineToLocalWallet) {
return InitError(_("Zcash was not built with wallet support. Set -minetolocalwallet=0 to use -mineraddress, or rebuild Zcash with wallet support."));
}
if (!mapArgs.count("-mineraddress")) {
return InitError(_("Zcash was not built with wallet support. Set -mineraddress, or rebuild Zcash with wallet support."));
}
#endif // !ENABLE_WALLET

if (mapArgs.count("-mineraddress")) {
#ifdef ENABLE_WALLET
#ifdef ENABLE_WALLET
auto mineToLocalWallet = GetBoolArg("-minetolocalwallet", true);
bool minerAddressInLocalWallet = false;
if (pwalletMain) {
Expand All @@ -1482,12 +1492,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
if (mineToLocalWallet && !minerAddressInLocalWallet) {
return InitError(_("-mineraddress is not in the local wallet. Either use a local address, or set -minetolocalwallet=0"));
}
#else // ENABLE_WALLET
auto mineToLocalWallet = GetBoolArg("-minetolocalwallet", false);
if (mineToLocalWallet) {
return InitError(_("Zcash was not built with wallet support. Set -minetolocalwallet=0 to use -mineraddress, or rebuild Zcash with wallet support."));
}
#endif // !ENABLE_WALLET
#endif // ENABLE_WALLET
}
#endif // ENABLE_MINING

Expand Down

0 comments on commit 9bba9b3

Please sign in to comment.