Apply suggestions from code review #2646
Co-Authored-By: PastaPastaPasta <pasta@dashboost.org>
This commit is contained in:
parent
c70aa60792
commit
30b03863ee
@ -93,6 +93,8 @@ UniValue getinfo(const JSONRPCRequest& request)
|
|||||||
if (pwallet) {
|
if (pwallet) {
|
||||||
obj.push_back(Pair("walletversion", pwallet->GetVersion()));
|
obj.push_back(Pair("walletversion", pwallet->GetVersion()));
|
||||||
obj.push_back(Pair("balance", ValueFromAmount(pwallet->GetBalance())));
|
obj.push_back(Pair("balance", ValueFromAmount(pwallet->GetBalance())));
|
||||||
|
if(!fLiteMode)
|
||||||
|
obj.push_back(Pair("privatesend_balance", ValueFromAmount(pwallet->GetAnonymizedBalance())));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
obj.push_back(Pair("blocks", (int)chainActive.Height()));
|
obj.push_back(Pair("blocks", (int)chainActive.Height()));
|
||||||
|
@ -513,9 +513,10 @@ UniValue importwallet(const JSONRPCRequest& request)
|
|||||||
file.close();
|
file.close();
|
||||||
pwallet->ShowProgress("", 100); // hide progress dialog in GUI
|
pwallet->ShowProgress("", 100); // hide progress dialog in GUI
|
||||||
|
|
||||||
|
pwallet->UpdateTimeFirstKey(nTimeBegin);
|
||||||
CBlockIndex* pindex = chainActive.FindEarliestAtLeast(nTimeBegin - TIMESTAMP_WINDOW);
|
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->ScanForWalletTransactions(pindex);
|
||||||
pwallet->MarkDirty();
|
pwallet->MarkDirty();
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ UniValue getnewaddress(const JSONRPCRequest& request)
|
|||||||
if (request.params.size() > 0)
|
if (request.params.size() > 0)
|
||||||
strAccount = AccountFromValue(request.params[0]);
|
strAccount = AccountFromValue(request.params[0]);
|
||||||
|
|
||||||
if (!pwallet->IsLocked()) {
|
if (!pwallet->IsLocked(true)) {
|
||||||
pwallet->TopUpKeyPool();
|
pwallet->TopUpKeyPool();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,7 +206,7 @@ UniValue getrawchangeaddress(const JSONRPCRequest& request)
|
|||||||
|
|
||||||
LOCK2(cs_main, pwallet->cs_wallet);
|
LOCK2(cs_main, pwallet->cs_wallet);
|
||||||
|
|
||||||
if (!pwallet->IsLocked()) {
|
if (!pwallet->IsLocked(true)) {
|
||||||
pwallet->TopUpKeyPool();
|
pwallet->TopUpKeyPool();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user