Skip to content

Commit

Permalink
Wallet: fix different signedness comparison (-Werror=sign-compare)
Browse files Browse the repository at this point in the history
Co-authored-by: Bertrand Jacquin <[email protected]>
  • Loading branch information
xiphon and bjacquin committed Oct 18, 2020
1 parent cb1f3ad commit 6ee5eff
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/libwalletqt/Wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1116,24 +1116,24 @@ Wallet::~Wallet()
void Wallet::startRefreshThread()
{
const auto future = m_scheduler.run([this] {
static constexpr const size_t refreshIntervalSec = 10;
static constexpr const size_t intervalResolutionMs = 100;
constexpr const std::chrono::seconds refreshInterval{10};
constexpr const std::chrono::milliseconds intervalResolution{100};

auto last = std::chrono::steady_clock::now();
while (!m_scheduler.stopping())
{
if (m_refreshEnabled)
{
const auto now = std::chrono::steady_clock::now();
const auto elapsed = std::chrono::duration_cast<std::chrono::seconds>(now - last).count();
if (elapsed >= refreshIntervalSec)
const auto elapsed = now - last;
if (elapsed >= refreshInterval)
{
refresh(false);
last = std::chrono::steady_clock::now();
}
}

std::this_thread::sleep_for(std::chrono::milliseconds(intervalResolutionMs));
std::this_thread::sleep_for(intervalResolution);
}
});
if (!future.first)
Expand Down

0 comments on commit 6ee5eff

Please sign in to comment.