diff --git a/src/lwsf_config.h b/src/lwsf_config.h index abc2736..7687eb3 100644 --- a/src/lwsf_config.h +++ b/src/lwsf_config.h @@ -41,7 +41,7 @@ namespace lwsf { namespace config }; constexpr const std::size_t bulletproof_version = 4; - constexpr const std::chrono::seconds connect_timeout{5}; + constexpr const std::chrono::seconds connect_timeout{10}; constexpr const std::chrono::seconds daemon_status_cache{10}; constexpr const std::string_view default_account_name{"Untitled account"}; constexpr const lookahead default_lookahead{50, 200}; @@ -57,5 +57,5 @@ namespace lwsf { namespace config constexpr const std::uint32_t mixin_default = 15; constexpr const std::chrono::seconds refresh_interval{30}; constexpr const std::chrono::seconds refresh_interval_min{5}; - constexpr const std::chrono::seconds rpc_timeout{5}; + constexpr const std::chrono::seconds rpc_timeout{30}; }} // lwsf // config diff --git a/src/rpc.cpp b/src/rpc.cpp index c9fdd3b..2a50634 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -98,6 +98,12 @@ namespace lwsf { namespace internal { namespace rpc {"Content-Type", "application/json; charset=utf-8"} }; + if (!client.is_connected()) + { + if (client.connect(config::connect_timeout)) + return {error::no_response}; + } + const epee::net_utils::http::http_response_info* response = nullptr; if (!client.invoke(endpoint, "POST", {reinterpret_cast(payload.data()), payload.size()}, config::rpc_timeout, std::addressof(response), headers)) return {error::no_response}; diff --git a/src/wire/wrapper/CMakeLists.txt b/src/wire/wrapper/CMakeLists.txt index c688bff..1bff208 100644 --- a/src/wire/wrapper/CMakeLists.txt +++ b/src/wire/wrapper/CMakeLists.txt @@ -31,5 +31,5 @@ set(lwsf-wire_headers variant.h) add_library(lwsf-wire-wrapper ${lwsf-wire_sources} ${lwsf-wire_headers}) target_include_directories(lwsf-wire-wrapper PUBLIC "${LMDB_INCLUDE}") -target_link_libraries(lwsf-wire-wrapper PRIVATE monero::libraries) +target_link_libraries(lwsf-wire-wrapper PRIVATE lwsf-wire monero::libraries)