Better error reporting for the !ENABLE_WALLET && ENABLE_MINING case.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
parent
f49bcdf92b
commit
9bba9b37c8
19
src/init.cpp
19
src/init.cpp
|
@ -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) {
|
||||
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue