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