Skip to content

Commit 30b0386

Browse files
Apply suggestions from code review #2646
Co-Authored-By: PastaPastaPasta <pasta@dashboost.org>
1 parent c70aa60 commit 30b0386

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/rpc/misc.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ UniValue getinfo(const JSONRPCRequest& request)
9393
if (pwallet) {
9494
obj.push_back(Pair("walletversion", pwallet->GetVersion()));
9595
obj.push_back(Pair("balance", ValueFromAmount(pwallet->GetBalance())));
96+
if(!fLiteMode)
97+
obj.push_back(Pair("privatesend_balance", ValueFromAmount(pwallet->GetAnonymizedBalance())));
9698
}
9799
#endif
98100
obj.push_back(Pair("blocks", (int)chainActive.Height()));

src/wallet/rpcdump.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,10 @@ UniValue importwallet(const JSONRPCRequest& request)
513513
file.close();
514514
pwallet->ShowProgress("", 100); // hide progress dialog in GUI
515515

516+
pwallet->UpdateTimeFirstKey(nTimeBegin);
516517
CBlockIndex* pindex = chainActive.FindEarliestAtLeast(nTimeBegin - TIMESTAMP_WINDOW);
517518

518-
LogPrintf("Rescanning last %i blocks\n", chainActive.Height() - pindex->nHeight + 1);
519+
LogPrintf("Rescanning last %i blocks\n", pindex ? chainActive.Height() - pindex->nHeight + 1 : 0);
519520
pwallet->ScanForWalletTransactions(pindex);
520521
pwallet->MarkDirty();
521522

src/wallet/rpcwallet.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ UniValue getnewaddress(const JSONRPCRequest& request)
124124
if (request.params.size() > 0)
125125
strAccount = AccountFromValue(request.params[0]);
126126

127-
if (!pwallet->IsLocked()) {
127+
if (!pwallet->IsLocked(true)) {
128128
pwallet->TopUpKeyPool();
129129
}
130130

@@ -206,7 +206,7 @@ UniValue getrawchangeaddress(const JSONRPCRequest& request)
206206

207207
LOCK2(cs_main, pwallet->cs_wallet);
208208

209-
if (!pwallet->IsLocked()) {
209+
if (!pwallet->IsLocked(true)) {
210210
pwallet->TopUpKeyPool();
211211
}
212212

0 commit comments

Comments
 (0)