From 6178277745932eda54f0c19df2f4c17b5c6366db Mon Sep 17 00:00:00 2001 From: SChernykh <15806605+SChernykh@users.noreply.github.com> Date: Wed, 19 Mar 2025 11:15:41 +0100 Subject: [PATCH] Switch to another host during startup if the current host is unavailable --- src/p2pool.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p2pool.cpp b/src/p2pool.cpp index b623a5b..e1d3399 100644 --- a/src/p2pool.cpp +++ b/src/p2pool.cpp @@ -1232,6 +1232,7 @@ void p2pool::parse_get_info_rpc(const char* data, size_t size) if (doc.HasParseError() || !doc.IsObject() || !doc.HasMember("result")) { LOGWARN(1, "get_info RPC response is invalid (\"result\" not found), trying again in 1 second"); std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + switch_host(); get_info(); return; } @@ -1249,6 +1250,7 @@ void p2pool::parse_get_info_rpc(const char* data, size_t size) !PARSE(result, info, stagenet)) { LOGWARN(1, "get_info RPC response is invalid, trying again in 1 second"); std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + switch_host(); get_info(); return; } @@ -1256,6 +1258,7 @@ void p2pool::parse_get_info_rpc(const char* data, size_t size) if (info.busy_syncing || !info.synchronized) { LOGINFO(1, "monerod is " << (info.busy_syncing ? "busy syncing" : "not synchronized") << ", trying again in 1 second"); std::this_thread::sleep_for(std::chrono::milliseconds(1000)); + switch_host(); get_info(); return; }