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)
This commit is contained in:
Riccardo Spagni 2017-03-18 20:29:22 +02:00
commit 9aac64c238
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
4 changed files with 62 additions and 20 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) {