diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-03-18 20:29:22 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-03-18 20:29:22 +0200 |
commit | 9aac64c2381864fe23866279d4bd973888a7080b (patch) | |
tree | cde1940e5e6ef7a05d89dda3c073035d355f0aff /src/wallet/wallet_rpc_server.cpp | |
parent | Merge pull request #1881 (diff) | |
parent | wallet2: call is_key_image_spent in blocks in rescan_spent (diff) | |
download | monero-9aac64c2381864fe23866279d4bd973888a7080b.tar.xz |
Merge pull request #1882
3fa59755 wallet2: call is_key_image_spent in blocks in rescan_spent (moneromooo-monero)
9d134e86 wallet_rpc_server: add a rescan_spent RPC (moneromooo-monero)
Diffstat (limited to 'src/wallet/wallet_rpc_server.cpp')
-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 cbbe83082..b07e413a4 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) { |