aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@bitpay.com>2013-08-25 22:02:57 -0400
committerJeff Garzik <jgarzik@bitpay.com>2013-10-02 05:51:13 -0400
commit28f6b8dbad27f0dac72daca6f1bfe41d7e701908 (patch)
tree06442b09b8ef4cfd947212d8af531d7d874e2998 /src
parent19e5ae7369de8ff556b2ea008850a62b1fde9a1b (diff)
RPC validateaddress: test pwalletMain for NULL (no-wallet mode)
Diffstat (limited to 'src')
-rw-r--r--src/rpcwallet.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp
index 4bf3580320..cafb6db9b1 100644
--- a/src/rpcwallet.cpp
+++ b/src/rpcwallet.cpp
@@ -1479,13 +1479,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].name));
}
return ret;