aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet_rpc_server.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-12-31 08:18:06 +0200
committerRiccardo Spagni <ric@spagni.net>2015-12-31 08:18:06 +0200
commit76a765c967145e1ed26712376814bd695f42153a (patch)
tree1e3f666d1b6a5646543d258c2962d8ffe35b705f /src/wallet/wallet_rpc_server.cpp
parent91001aa4460a59a42dc14a32c8e90717fd29dbd2 (diff)
parent576effe11a513507b14275c7a2e6fc3b18de5e17 (diff)
downloadmonzero-core-76a765c967145e1ed26712376814bd695f42153a.tar.gz
monzero-core-76a765c967145e1ed26712376814bd695f42153a.tar.xz
monzero-core-76a765c967145e1ed26712376814bd695f42153a.zip
Merge pull request #579
576effe blockchain: kill ioservice on scope end, rather than manually (moneromooo-monero) ed5d017 miner: minor fixes on stop (moneromooo-monero) b245215 core_tests: deinit core before destroying it (moneromooo-monero) bc8a52e wallet: add a rescan_bc command and rescan_blockchain RPC (moneromooo-monero) 92ef6b5 wallet: protect against exceptions in the block pull thread (moneromooo-monero) af21061 net_peerlist: move a couple functions from public to private (moneromooo-monero)
Diffstat (limited to 'src/wallet/wallet_rpc_server.cpp')
-rw-r--r--src/wallet/wallet_rpc_server.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index 0c1ea48c1..9f23908f9 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -646,6 +646,29 @@ namespace tools
return true;
}
+ //------------------------------------------------------------------------------------------------------------------------------
+ bool wallet_rpc_server::on_rescan_blockchain(const wallet_rpc::COMMAND_RPC_RESCAN_BLOCKCHAIN::request& req, wallet_rpc::COMMAND_RPC_RESCAN_BLOCKCHAIN::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_blockchain();
+ }
+ catch (std::exception& e)
+ {
+ er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR;
+ er.message = e.what();
+ return false;
+ }
+ return true;
+ }
+ //------------------------------------------------------------------------------------------------------------------------------
bool wallet_rpc_server::on_stop_wallet(const wallet_rpc::COMMAND_RPC_STOP_WALLET::request& req, wallet_rpc::COMMAND_RPC_STOP_WALLET::response& res, epee::json_rpc::error& er)
{
if (m_wallet.restricted())