aboutsummaryrefslogtreecommitdiff
path: root/src/rpcwallet.cpp
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@bitpay.com>2013-10-01 16:18:50 -0400
committerJeff Garzik <jgarzik@bitpay.com>2013-10-01 16:18:50 -0400
commit19e5ae7369de8ff556b2ea008850a62b1fde9a1b (patch)
tree4b712da1581c88940fd7fcf1a4dc184419eec792 /src/rpcwallet.cpp
parentb63ae2a5349ecc62a52c4e7bce1421652110e988 (diff)
parentb0730874d95e42953736f49d8041221d698ed95a (diff)
downloadbitcoin-19e5ae7369de8ff556b2ea008850a62b1fde9a1b.tar.xz
Merge branch 'pwalletmain' - checking pwalletMain for NULL,
a pre-req for no-wallet support.
Diffstat (limited to 'src/rpcwallet.cpp')
-rw-r--r--src/rpcwallet.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp
index 46338bdf26..4bf3580320 100644
--- a/src/rpcwallet.cpp
+++ b/src/rpcwallet.cpp
@@ -21,7 +21,7 @@ static CCriticalSection cs_nWalletUnlockTime;
std::string HelpRequiringPassphrase()
{
- return pwalletMain->IsCrypted()
+ return pwalletMain && pwalletMain->IsCrypted()
? "\nrequires wallet passphrase to be set with walletpassphrase first"
: "";
}
@@ -72,18 +72,22 @@ Value getinfo(const Array& params, bool fHelp)
Object obj;
obj.push_back(Pair("version", (int)CLIENT_VERSION));
obj.push_back(Pair("protocolversion",(int)PROTOCOL_VERSION));
- obj.push_back(Pair("walletversion", pwalletMain->GetVersion()));
- obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance())));
+ if (pwalletMain) {
+ obj.push_back(Pair("walletversion", pwalletMain->GetVersion()));
+ obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance())));
+ }
obj.push_back(Pair("blocks", (int)nBestHeight));
obj.push_back(Pair("timeoffset", (boost::int64_t)GetTimeOffset()));
obj.push_back(Pair("connections", (int)vNodes.size()));
obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string())));
obj.push_back(Pair("difficulty", (double)GetDifficulty()));
obj.push_back(Pair("testnet", TestNet()));
- obj.push_back(Pair("keypoololdest", (boost::int64_t)pwalletMain->GetOldestKeyPoolTime()));
- obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize()));
+ if (pwalletMain) {
+ obj.push_back(Pair("keypoololdest", (boost::int64_t)pwalletMain->GetOldestKeyPoolTime()));
+ obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize()));
+ }
obj.push_back(Pair("paytxfee", ValueFromAmount(nTransactionFee)));
- if (pwalletMain->IsCrypted())
+ if (pwalletMain && pwalletMain->IsCrypted())
obj.push_back(Pair("unlocked_until", (boost::int64_t)nWalletUnlockTime));
obj.push_back(Pair("errors", GetWarnings("statusbar")));
return obj;
@@ -738,7 +742,7 @@ static CScript _createmultisig(const Array& params)
// Case 1: Bitcoin address and we have full public key:
CBitcoinAddress address(ks);
- if (address.IsValid())
+ if (pwalletMain && address.IsValid())
{
CKeyID keyID;
if (!address.GetKeyID(keyID))