RPC validateaddress: test pwalletMain for NULL (no-wallet mode)
This commit is contained in:
parent
19e5ae7369
commit
28f6b8dbad
1 changed files with 2 additions and 2 deletions
|
@ -1479,13 +1479,13 @@ Value validateaddress(const Array& params, bool fHelp)
|
||||||
CTxDestination dest = address.Get();
|
CTxDestination dest = address.Get();
|
||||||
string currentAddress = address.ToString();
|
string currentAddress = address.ToString();
|
||||||
ret.push_back(Pair("address", currentAddress));
|
ret.push_back(Pair("address", currentAddress));
|
||||||
bool fMine = IsMine(*pwalletMain, dest);
|
bool fMine = pwalletMain ? IsMine(*pwalletMain, dest) : false;
|
||||||
ret.push_back(Pair("ismine", fMine));
|
ret.push_back(Pair("ismine", fMine));
|
||||||
if (fMine) {
|
if (fMine) {
|
||||||
Object detail = boost::apply_visitor(DescribeAddressVisitor(), dest);
|
Object detail = boost::apply_visitor(DescribeAddressVisitor(), dest);
|
||||||
ret.insert(ret.end(), detail.begin(), detail.end());
|
ret.insert(ret.end(), detail.begin(), detail.end());
|
||||||
}
|
}
|
||||||
if (pwalletMain->mapAddressBook.count(dest))
|
if (pwalletMain && pwalletMain->mapAddressBook.count(dest))
|
||||||
ret.push_back(Pair("account", pwalletMain->mapAddressBook[dest].name));
|
ret.push_back(Pair("account", pwalletMain->mapAddressBook[dest].name));
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue