mirror of
https://github.com/SChernykh/p2pool.git
synced 2024-08-20 05:28:47 -06:00
Fix: don't start until monerod is fully synchronized
This commit is contained in:
parent
88f346414a
commit
3d60ae8c32
@ -688,18 +688,22 @@ void p2pool::parse_get_info_rpc(const char* data, size_t size)
|
|||||||
const auto& result = doc["result"];
|
const auto& result = doc["result"];
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
bool busy_syncing, mainnet, testnet, stagenet;
|
bool busy_syncing, synchronized, mainnet, testnet, stagenet;
|
||||||
} info;
|
} info;
|
||||||
|
|
||||||
if (!PARSE(result, info, busy_syncing) || !PARSE(result, info, mainnet) || !PARSE(result, info, testnet) || !PARSE(result, info, stagenet)) {
|
if (!PARSE(result, info, busy_syncing) ||
|
||||||
|
!PARSE(result, info, synchronized) ||
|
||||||
|
!PARSE(result, info, mainnet) ||
|
||||||
|
!PARSE(result, info, testnet) ||
|
||||||
|
!PARSE(result, info, stagenet)) {
|
||||||
LOGWARN(1, "get_info RPC response is invalid, trying again in 1 second");
|
LOGWARN(1, "get_info RPC response is invalid, trying again in 1 second");
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||||
get_info();
|
get_info();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.busy_syncing) {
|
if (info.busy_syncing || !info.synchronized) {
|
||||||
LOGINFO(1, "monerod is busy syncing, trying again in 1 second");
|
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));
|
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||||
get_info();
|
get_info();
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user