RPC validateaddress: test pwalletMain for NULL (no-wallet mode)
Conflicts: src/rpcwallet.cpp Rebased-from: b878f6a92436e3facd700e2e10c04f541cd6421b
This commit is contained in:
parent
a288878a00
commit
a7909372bd
@ -1524,13 +1524,13 @@ Value validateaddress(const Array& params, bool fHelp)
|
||||
CTxDestination dest = address.Get();
|
||||
string currentAddress = address.ToString();
|
||||
ret.push_back(Pair("address", currentAddress));
|
||||
bool fMine = IsMine(*pwalletMain, dest);
|
||||
bool fMine = pwalletMain ? IsMine(*pwalletMain, dest) : false;
|
||||
ret.push_back(Pair("ismine", fMine));
|
||||
if (fMine) {
|
||||
Object detail = boost::apply_visitor(DescribeAddressVisitor(), dest);
|
||||
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]));
|
||||
}
|
||||
return ret;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user