Fix ZeroMQ resend bug in scanner loop

This commit is contained in:
Lee *!* Clagett 2021-08-20 19:22:38 -04:00
parent dbbdee6fd4
commit 346732014a

View file

@ -367,15 +367,11 @@ namespace lws
auto resp = client.get_message(block_rpc_timeout);
if (!resp)
{
if (resp.matches(std::errc::interrupted))
return; // a signal was sent over ZMQ
if (resp.matches(std::errc::timed_out))
{
MWARNING("Block retrieval timeout, retrying");
if (!send(client, block_request.clone()))
return;
continue; // to next get_blocks_fast read
}
const bool timeout = resp.matches(std::errc::timed_out);
if (timeout)
MWARNING("Block retrieval timeout, resetting scanner");
if (timeout || resp.matches(std::errc::interrupted))
return;
MONERO_THROW(resp.error(), "Failed to retrieve blocks from daemon");
}