Skip to content

Commit

Permalink
Corrections for getExpiringPollsNotNotified() in votingmodel
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescowens committed Dec 10, 2023
1 parent adaa443 commit 6fcd4e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/qt/voting/votingmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ VotingModel::VotingModel(
m_last_poll_time = std::max(m_last_poll_time, iter->Ref().Time());
}
}

m_poll_expire_warning = static_cast<qint64>(m_options_model.getPollExpireNotification() * 3600.0 * 1000.0);
}

VotingModel::~VotingModel()
Expand Down Expand Up @@ -259,9 +257,11 @@ QStringList VotingModel::getExpiringPollsNotNotified()

QDateTime now = QDateTime::fromMSecsSinceEpoch(GetAdjustedTime() * 1000);

qint64 poll_expire_warning = static_cast<qint64>(m_options_model.getPollExpireNotification() * 3600.0 * 1000.0);

// Populate the list and mark the poll items included in the list m_expire_notified true.
for (auto& poll : m_pollitems) {
if (now.msecsTo(poll.second.m_expiration) <= m_poll_expire_warning
if (now.msecsTo(poll.second.m_expiration) <= poll_expire_warning
&& !poll.second.m_expire_notified
&& !poll.second.m_self_voted) {
expiring_polls << poll.second.m_title;
Expand Down
2 changes: 0 additions & 2 deletions src/qt/voting/votingmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ class VotingModel : public QObject
void newVoteReceived(QString poll_txid_string);

private:
qint64 m_poll_expire_warning;

GRC::PollRegistry& m_registry;
ClientModel& m_client_model;
OptionsModel& m_options_model;
Expand Down

0 comments on commit 6fcd4e9

Please sign in to comment.