Fix rescan RPC to correctly use the optional rescan height
This commit is contained in:
@@ -36,6 +36,7 @@ public:
|
||||
|
||||
static const CRPCConvertParam vRPCConvertParams[] =
|
||||
{
|
||||
{ "rescan", 0 },
|
||||
{ "stop", 0 },
|
||||
{ "setmocktime", 0 },
|
||||
{ "getaddednodeinfo", 0 },
|
||||
|
||||
@@ -178,9 +178,12 @@ UniValue rescan(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||
}
|
||||
|
||||
LogPrintf("Rescanning from height=%d\n", nRescanHeight);
|
||||
//pwalletMain->ScanForWalletTransactions(chainActive[nRescanHeight],true);
|
||||
bool update = false;
|
||||
pwalletMain->ScanForWalletTransactions(chainActive.Genesis(),update);
|
||||
bool update = true;
|
||||
if (nRescanHeight > 0) {
|
||||
pwalletMain->ScanForWalletTransactions(chainActive[nRescanHeight],update);
|
||||
} else {
|
||||
pwalletMain->ScanForWalletTransactions(chainActive.Genesis(),update);
|
||||
}
|
||||
//TODO: can we return something more useful?
|
||||
return NullUniValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user