Update operating mode upon network disagreement.

This commit is contained in:
Mark Travis
2019-09-06 13:03:30 -07:00
committed by Nik Bougalis
parent a9a4e2c8fb
commit e5b61c9ac9
11 changed files with 133 additions and 88 deletions

View File

@@ -212,11 +212,12 @@ ShardArchiveHandler::complete(path dstPath)
{
// If validating and not synced then defer and retry
auto const mode {ptr->app_.getOPs().getOperatingMode()};
if (ptr->validate_ && mode != NetworkOPs::omFULL)
if (ptr->validate_ && mode != OperatingMode::FULL)
{
std::lock_guard lock(m_);
timer_.expires_from_now(static_cast<std::chrono::seconds>(
(NetworkOPs::omFULL - mode) * 10));
(static_cast<std::size_t>(OperatingMode::FULL)
- static_cast<std::size_t>(mode)) * 10));
timer_.async_wait(
[=, dstPath = std::move(dstPath), ptr = std::move(ptr)]
(boost::system::error_code const& ec)