Better error reporting for the !ENABLE_WALLET && ENABLE_MINING case.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
19
src/init.cpp
19
src/init.cpp
@@ -1468,8 +1468,18 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
#endif // !ENABLE_WALLET
|
#endif // !ENABLE_WALLET
|
||||||
|
|
||||||
#ifdef ENABLE_MINING
|
#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")) {
|
if (mapArgs.count("-mineraddress")) {
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
auto mineToLocalWallet = GetBoolArg("-minetolocalwallet", true);
|
auto mineToLocalWallet = GetBoolArg("-minetolocalwallet", true);
|
||||||
bool minerAddressInLocalWallet = false;
|
bool minerAddressInLocalWallet = false;
|
||||||
if (pwalletMain) {
|
if (pwalletMain) {
|
||||||
@@ -1482,12 +1492,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
if (mineToLocalWallet && !minerAddressInLocalWallet) {
|
if (mineToLocalWallet && !minerAddressInLocalWallet) {
|
||||||
return InitError(_("-mineraddress is not in the local wallet. Either use a local address, or set -minetolocalwallet=0"));
|
return InitError(_("-mineraddress is not in the local wallet. Either use a local address, or set -minetolocalwallet=0"));
|
||||||
}
|
}
|
||||||
#else // ENABLE_WALLET
|
#endif // 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_MINING
|
#endif // ENABLE_MINING
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user