aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet_rpc_server.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-03-18 20:29:22 +0200
committerRiccardo Spagni <ric@spagni.net>2017-03-18 20:29:22 +0200
commit9aac64c2381864fe23866279d4bd973888a7080b (patch)
treecde1940e5e6ef7a05d89dda3c073035d355f0aff /src/wallet/wallet_rpc_server.cpp
parentMerge pull request #1881 (diff)
parentwallet2: call is_key_image_spent in blocks in rescan_spent (diff)
downloadmonero-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.cpp22
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) {