wallet: create set_subaddress_lookahead wallet rpc endpoint

This commit is contained in:
benevanoff 2023-11-03 18:40:57 -05:00 committed by nahuhh
parent b987676d63
commit 6f36037116
5 changed files with 63 additions and 1 deletions

View file

@ -704,6 +704,18 @@ namespace tools
res.index = *index;
return true;
}
bool wallet_rpc_server::on_set_subaddr_lookahead(const wallet_rpc::COMMAND_RPC_SET_SUBADDR_LOOKAHEAD::request& req, wallet_rpc::COMMAND_RPC_SET_SUBADDR_LOOKAHEAD::response& res, epee::json_rpc::error& er, const connection_context *ctx)
{
if (!m_wallet) return not_open(er);
try {
m_wallet->set_subaddress_lookahead(req.major_idx, req.minor_idx);
}
catch (const std::exception& e) {
handle_rpc_exception(std::current_exception(), er, WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR);
return false;
}
return true;
}
//------------------------------------------------------------------------------------------------------------------------------
bool wallet_rpc_server::on_create_address(const wallet_rpc::COMMAND_RPC_CREATE_ADDRESS::request& req, wallet_rpc::COMMAND_RPC_CREATE_ADDRESS::response& res, epee::json_rpc::error& er, const connection_context *ctx)
{