diff options
-rw-r--r-- | src/wallet/rpc/backup.cpp | 27 | ||||
-rw-r--r-- | src/wallet/rpc/transactions.cpp | 27 | ||||
-rw-r--r-- | src/wallet/rpc/wallet.cpp | 2 |
3 files changed, 28 insertions, 28 deletions
diff --git a/src/wallet/rpc/backup.cpp b/src/wallet/rpc/backup.cpp index 7e06ff0e4f..135c3a15f2 100644 --- a/src/wallet/rpc/backup.cpp +++ b/src/wallet/rpc/backup.cpp @@ -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() { return RPCHelpMan{"importaddress", diff --git a/src/wallet/rpc/transactions.cpp b/src/wallet/rpc/transactions.cpp index 36acbdc9f6..cf828d6339 100644 --- a/src/wallet/rpc/transactions.cpp +++ b/src/wallet/rpc/transactions.cpp @@ -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; +}, + }; +} diff --git a/src/wallet/rpc/wallet.cpp b/src/wallet/rpc/wallet.cpp index a4f300019e..99ffe5d964 100644 --- a/src/wallet/rpc/wallet.cpp +++ b/src/wallet/rpc/wallet.cpp @@ -590,7 +590,6 @@ RPCHelpMan walletdisplayaddress(); #endif // ENABLE_EXTERNAL_SIGNER // backup -RPCHelpMan abortrescan(); RPCHelpMan dumpprivkey(); RPCHelpMan importprivkey(); RPCHelpMan importaddress(); @@ -644,6 +643,7 @@ RPCHelpMan listsinceblock(); RPCHelpMan gettransaction(); RPCHelpMan abandontransaction(); RPCHelpMan rescanblockchain(); +RPCHelpMan abortrescan(); Span<const CRPCCommand> GetWalletRPCCommands() { |