wallet: add a node RPC cache layer for simple RPC calls

Mostly getinfo and get_hard_fork_info, which are called
pretty often. This speeds up transfers as a bonus.
This commit is contained in:
moneromooo-monero
2017-01-16 08:59:15 +00:00
parent d86ae2bec6
commit 693c190881
6 changed files with 259 additions and 79 deletions
+12
View File
@@ -626,6 +626,18 @@ namespace tools
std::string m_request;
};
//----------------------------------------------------------------------------------------------------
struct wallet_generic_rpc_error : public wallet_rpc_error
{
explicit wallet_generic_rpc_error(std::string&& loc, const std::string& request, const std::string& status)
: wallet_rpc_error(std::move(loc), std::string("error in ") + request + " RPC: " + status, request),
m_status(status)
{
}
const std::string& status() const { return m_status; }
private:
const std::string m_status;
};
//----------------------------------------------------------------------------------------------------
struct daemon_busy : public wallet_rpc_error
{
explicit daemon_busy(std::string&& loc, const std::string& request)