diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-02-02 19:32:01 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-02-02 19:32:01 +0200 |
commit | 5fb3f97a55a9b8f31a69119c41557a9774deffb5 (patch) | |
tree | abf27b7fd1bf7fc164ce91f5179dbddf899112db /src/wallet/wallet2.h | |
parent | Merge pull request #1628 (diff) | |
parent | Updates to epee HTTP client code (diff) | |
download | monero-5fb3f97a55a9b8f31a69119c41557a9774deffb5.tar.xz |
Merge pull request #1629
c02e1cb9 Updates to epee HTTP client code - http_simple_client now uses std::chrono for timeouts - http_simple_client accepts timeouts per connect / invoke call - shortened names of epee http invoke functions - invoke command functions only take relative path, connection is not automatically performed (Lee Clagett)
Diffstat (limited to 'src/wallet/wallet2.h')
-rw-r--r-- | src/wallet/wallet2.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index e136c568c..91d4db47e 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -61,8 +61,6 @@ #undef MONERO_DEFAULT_LOG_CATEGORY #define MONERO_DEFAULT_LOG_CATEGORY "wallet.wallet2" -#define WALLET_RCP_CONNECTION_TIMEOUT 200000 - class Serialization_portability_wallet_Test; namespace tools @@ -96,6 +94,8 @@ namespace tools { friend class ::Serialization_portability_wallet_Test; public: + static constexpr const std::chrono::seconds rpc_timeout = std::chrono::minutes(3) + std::chrono::seconds(30); + enum RefreshType { RefreshFull, RefreshOptimizeCoinbase, @@ -107,7 +107,7 @@ namespace tools wallet2(const wallet2&) : m_run(true), m_callback(0), m_testnet(false), m_always_confirm_transfers(true), m_print_ring_members(false), m_store_tx_info(true), m_default_mixin(0), m_default_priority(0), m_refresh_type(RefreshOptimizeCoinbase), m_auto_refresh(true), m_refresh_from_block_height(0), m_confirm_missing_payment_id(true), m_node_rpc_proxy(m_http_client, m_daemon_rpc_mutex) {} public: - static const char* tr(const char* str);// { return i18n_translate(str, "cryptonote::simple_wallet"); } + static const char* tr(const char* str); static bool has_testnet_option(const boost::program_options::variables_map& vm); static void init_options(boost::program_options::options_description& desc_params); @@ -342,8 +342,8 @@ namespace tools // free block size. TODO: fix this so that it actually takes // into account the current median block size rather than // the minimum block size. - void init(const std::string& daemon_address = "http://localhost:8080", uint64_t upper_transaction_size_limit = 0); bool deinit(); + bool init(std::string daemon_address = "http://localhost:8080", uint64_t upper_transaction_size_limit = 0); void stop() { m_run.store(false, std::memory_order_relaxed); } @@ -1018,7 +1018,7 @@ namespace tools } m_daemon_rpc_mutex.lock(); - bool r = epee::net_utils::invoke_http_bin_remote_command2(m_daemon_address + "/getrandom_outs.bin", req, daemon_resp, m_http_client, 200000); + bool r = epee::net_utils::invoke_http_bin("/getrandom_outs.bin", req, daemon_resp, m_http_client, rpc_timeout); m_daemon_rpc_mutex.unlock(); THROW_WALLET_EXCEPTION_IF(!r, error::no_connection_to_daemon, "getrandom_outs.bin"); THROW_WALLET_EXCEPTION_IF(daemon_resp.status == CORE_RPC_STATUS_BUSY, error::daemon_busy, "getrandom_outs.bin"); |