Retry get_block_headers_range RPC call if it fails

pull/226/head
SChernykh 2 years ago
parent ae9905e4c7
commit cc92ae7998

@ -677,14 +677,14 @@ void p2pool::download_block_headers(uint64_t current_height)
} }
} }
else { else {
LOGERR(1, "fatal error: couldn't download block header for height " << height); LOGERR(1, "fatal error: couldn't download block header for seed height " << height);
panic(); panic();
} }
}, },
[height](const char* data, size_t size) [height](const char* data, size_t size)
{ {
if (size > 0) { if (size > 0) {
LOGERR(1, "fatal error: couldn't download block header for height " << height << ", error " << log::const_buf(data, size)); LOGERR(1, "fatal error: couldn't download block header for seed height " << height << ", error " << log::const_buf(data, size));
panic(); panic();
} }
}); });
@ -720,15 +720,15 @@ void p2pool::download_block_headers(uint64_t current_height)
} }
} }
else { else {
LOGERR(1, "fatal error: couldn't download block headers for heights " << start_height << " - " << current_height - 1); LOGERR(1, "Couldn't download block headers for heights " << start_height << " - " << current_height - 1);
panic(); download_block_headers(current_height);
} }
}, },
[start_height, current_height](const char* data, size_t size) [this, start_height, current_height](const char* data, size_t size)
{ {
if (size > 0) { if (size > 0) {
LOGERR(1, "fatal error: couldn't download block headers for heights " << start_height << " - " << current_height - 1 << ", error " << log::const_buf(data, size)); LOGERR(1, "Couldn't download block headers for heights " << start_height << " - " << current_height - 1 << ", error " << log::const_buf(data, size));
panic(); download_block_headers(current_height);
} }
}); });
} }

Loading…
Cancel
Save