diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-03-18 12:04:17 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-03-18 12:04:17 +0000 |
commit | 9d134e864729b7279c90a343bf3433bec4e4a933 (patch) | |
tree | 7d87d610d2f29b522da1156e866029d0d4d3d647 /src/wallet/wallet_rpc_server.cpp | |
parent | Merge pull request #1869 (diff) | |
download | monero-9d134e864729b7279c90a343bf3433bec4e4a933.tar.xz |
wallet_rpc_server: add a rescan_spent RPC
Diffstat (limited to '')
-rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index be8e0057d..b8b966346 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -1374,6 +1374,28 @@ namespace tools return true; } //------------------------------------------------------------------------------------------------------------------------------ + bool wallet_rpc_server::on_rescan_spent(const wallet_rpc::COMMAND_RPC_RESCAN_SPENT::request& req, wallet_rpc::COMMAND_RPC_RESCAN_SPENT::response& res, epee::json_rpc::error& er) + { + if (m_wallet.restricted()) + { + er.code = WALLET_RPC_ERROR_CODE_DENIED; + er.message = "Command unavailable in restricted mode."; + return false; + } + try + { + m_wallet.rescan_spent(); + return true; + } + catch (const std::exception &e) + { + er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR; + er.message = e.what(); + return false; + } + return true; + } + //------------------------------------------------------------------------------------------------------------------------------ } int main(int argc, char** argv) { |