wallet_rpc_server: add a rescan_spent RPC

This commit is contained in:
moneromooo-monero 2017-03-18 12:04:17 +00:00
parent c642d3224c
commit 9d134e8647
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
3 changed files with 39 additions and 0 deletions

View file

@ -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) {