Use CBitcoinAddress wrappers in Zcash-specific code

This commit is contained in:
Jack Grigg
2018-04-20 15:09:23 +01:00
parent 07444da1db
commit b6be3e88bb
12 changed files with 78 additions and 80 deletions

View File

@@ -1079,8 +1079,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
#ifdef ENABLE_MINING
if (mapArgs.count("-mineraddress")) {
CBitcoinAddress addr;
if (!addr.SetString(mapArgs["-mineraddress"])) {
CTxDestination addr = DecodeDestination(mapArgs["-mineraddress"]);
if (!IsValidDestination(addr)) {
return InitError(strprintf(
_("Invalid address for -mineraddress=<addr>: '%s' (must be a transparent address)"),
mapArgs["-mineraddress"]));
@@ -1717,9 +1717,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
bool minerAddressInLocalWallet = false;
if (pwalletMain) {
// Address has alreday been validated
CBitcoinAddress addr(mapArgs["-mineraddress"]);
CKeyID keyID;
addr.GetKeyID(keyID);
CTxDestination addr = DecodeDestination(mapArgs["-mineraddress"]);
CKeyID keyID = boost::get<CKeyID>(addr);
minerAddressInLocalWallet = pwalletMain->HaveKey(keyID);
}
if (GetBoolArg("-minetolocalwallet", true) && !minerAddressInLocalWallet) {