node_rpc_proxy: factor a few RPC calls using get_info

Takes advantage of caching
This commit is contained in:
moneromooo-monero 2018-06-30 22:06:09 +01:00
parent a9b83f5a6e
commit 8c4db68ff7
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
4 changed files with 58 additions and 86 deletions

View file

@ -4277,12 +4277,7 @@ uint64_t simple_wallet::get_daemon_blockchain_height(std::string& err)
{
throw std::runtime_error("simple_wallet null wallet");
}
COMMAND_RPC_GET_HEIGHT::request req;
COMMAND_RPC_GET_HEIGHT::response res = boost::value_initialized<COMMAND_RPC_GET_HEIGHT::response>();
bool r = m_wallet->invoke_http_json("/getheight", req, res);
err = interpret_rpc_response(r, res.status);
return res.height;
return m_wallet->get_daemon_blockchain_height(err);
}
//----------------------------------------------------------------------------------------------------
bool simple_wallet::show_blockchain_height(const std::vector<std::string>& args)