diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index feb23ec0b..f67bc9d74 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -93,6 +93,8 @@ UniValue getinfo(const JSONRPCRequest& request) if (pwallet) { obj.push_back(Pair("walletversion", pwallet->GetVersion())); obj.push_back(Pair("balance", ValueFromAmount(pwallet->GetBalance()))); + if(!fLiteMode) + obj.push_back(Pair("privatesend_balance", ValueFromAmount(pwallet->GetAnonymizedBalance()))); } #endif obj.push_back(Pair("blocks", (int)chainActive.Height())); diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 42281988f..c79a375a3 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -513,9 +513,10 @@ UniValue importwallet(const JSONRPCRequest& request) file.close(); pwallet->ShowProgress("", 100); // hide progress dialog in GUI + pwallet->UpdateTimeFirstKey(nTimeBegin); CBlockIndex* pindex = chainActive.FindEarliestAtLeast(nTimeBegin - TIMESTAMP_WINDOW); - LogPrintf("Rescanning last %i blocks\n", chainActive.Height() - pindex->nHeight + 1); + LogPrintf("Rescanning last %i blocks\n", pindex ? chainActive.Height() - pindex->nHeight + 1 : 0); pwallet->ScanForWalletTransactions(pindex); pwallet->MarkDirty(); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index e7c7c28e6..dc584a21a 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -124,7 +124,7 @@ UniValue getnewaddress(const JSONRPCRequest& request) if (request.params.size() > 0) strAccount = AccountFromValue(request.params[0]); - if (!pwallet->IsLocked()) { + if (!pwallet->IsLocked(true)) { pwallet->TopUpKeyPool(); } @@ -206,7 +206,7 @@ UniValue getrawchangeaddress(const JSONRPCRequest& request) LOCK2(cs_main, pwallet->cs_wallet); - if (!pwallet->IsLocked()) { + if (!pwallet->IsLocked(true)) { pwallet->TopUpKeyPool(); }