MOVEONLY: Move abortrescan from backup.cpp to transactions.cpp

This commit is contained in:
Samuel Dobson committed 2021-12-08 11:54:08 +13:00
1 parent d794d0da8f
commit b36e738285
3 files changed
+28 -28

No files matched your search

-27
View File
@@ -193,33 +193,6 @@ RPCHelpMan importprivkey()
}; };
} }
RPCHelpMan abortrescan()
{
return RPCHelpMan{"abortrescan",
"\nStops current wallet rescan triggered by an RPC call, e.g. by an importprivkey call.\n"
"Note: Use \"getwalletinfo\" to query the scanning progress.\n",
{},
RPCResult{RPCResult::Type::BOOL, "", "Whether the abort was successful"},
RPCExamples{
"\nImport a private key\n"
+ HelpExampleCli("importprivkey", "\"mykey\"") +
"\nAbort the running wallet rescan\n"
+ HelpExampleCli("abortrescan", "") +
"\nAs a JSON-RPC call\n"
+ HelpExampleRpc("abortrescan", "")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest(request);
if (!pwallet) return NullUniValue;
if (!pwallet->IsScanning() || pwallet->IsAbortingRescan()) return false;
pwallet->AbortRescan();
return true;
},
};
}
RPCHelpMan importaddress() RPCHelpMan importaddress()
{ {
return RPCHelpMan{"importaddress", return RPCHelpMan{"importaddress",
+27
View File
@@ -931,3 +931,30 @@ RPCHelpMan rescanblockchain()
}, },
}; };
} }
RPCHelpMan abortrescan()
{
return RPCHelpMan{"abortrescan",
"\nStops current wallet rescan triggered by an RPC call, e.g. by an importprivkey call.\n"
"Note: Use \"getwalletinfo\" to query the scanning progress.\n",
{},
RPCResult{RPCResult::Type::BOOL, "", "Whether the abort was successful"},
RPCExamples{
"\nImport a private key\n"
+ HelpExampleCli("importprivkey", "\"mykey\"") +
"\nAbort the running wallet rescan\n"
+ HelpExampleCli("abortrescan", "") +
"\nAs a JSON-RPC call\n"
+ HelpExampleRpc("abortrescan", "")
},
[&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
{
std::shared_ptr<CWallet> const pwallet = GetWalletForJSONRPCRequest(request);
if (!pwallet) return NullUniValue;
if (!pwallet->IsScanning() || pwallet->IsAbortingRescan()) return false;
pwallet->AbortRescan();
return true;
},
};
}
+1 -1
View File
@@ -590,7 +590,6 @@ RPCHelpMan walletdisplayaddress();
#endif // ENABLE_EXTERNAL_SIGNER #endif // ENABLE_EXTERNAL_SIGNER
// backup // backup
RPCHelpMan abortrescan();
RPCHelpMan dumpprivkey(); RPCHelpMan dumpprivkey();
RPCHelpMan importprivkey(); RPCHelpMan importprivkey();
RPCHelpMan importaddress(); RPCHelpMan importaddress();
@@ -644,6 +643,7 @@ RPCHelpMan listsinceblock();
RPCHelpMan gettransaction(); RPCHelpMan gettransaction();
RPCHelpMan abandontransaction(); RPCHelpMan abandontransaction();
RPCHelpMan rescanblockchain(); RPCHelpMan rescanblockchain();
RPCHelpMan abortrescan();
Span<const CRPCCommand> GetWalletRPCCommands() Span<const CRPCCommand> GetWalletRPCCommands()
{ {