From a7909372bdf7720bafb84ff67e0858978a4907fc Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sun, 25 Aug 2013 22:02:57 -0400 Subject: [PATCH] RPC validateaddress: test pwalletMain for NULL (no-wallet mode) Conflicts: src/rpcwallet.cpp Rebased-from: b878f6a92436e3facd700e2e10c04f541cd6421b --- src/rpcwallet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 50ccee399..73ee8289e 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -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;