Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gui: Fix expired pending beacon display #2698

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions depends/packages/zlib.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package=zlib
$(package)_version=1.2.13
$(package)_version=1.3
$(package)_download_path=https://www.zlib.net
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30
$(package)_sha256_hash=ff0ba4c292013dbc27530b3a81e1f9a813cd39de01ca5e0f8bf355702efa593e

define $(package)_set_vars
$(package)_config_opts= CC="$($(package)_cc)"
Expand Down
2 changes: 1 addition & 1 deletion src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1884,7 +1884,7 @@ void BitcoinGUI::updateBeaconIcon()

if (researcherModel->hasPendingBeacon()) {
labelBeaconIcon->setToolTip(tr("CPID: %1\n"
"Time left to activate: %2"
"Time left to activate: %2\n"
"%3")
.arg(researcherModel->formatCpid(),
researcherModel->formatTimeToPendingBeaconExpiration(),
Expand Down
12 changes: 11 additions & 1 deletion src/qt/researcher/researchermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,17 @@ bool ResearcherModel::hasActiveBeacon() const

bool ResearcherModel::hasPendingBeacon() const
{
return m_pending_beacon.operator bool();
if (!m_pending_beacon.operator bool()) {
return false;
}

// If here, a pending beacon is present. Determine if expired
// while pending. No need to actually clean the pending entry
// up. It will be eventually cleaned by the contract handler via
// the ActivatePending call.
GRC::PendingBeacon pending_beacon(*m_pending_beacon);

return !pending_beacon.PendingExpired(GetAdjustedTime());
}

bool ResearcherModel::hasRenewableBeacon() const
Expand Down
5 changes: 5 additions & 0 deletions src/qt/researcher/researchermodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ class ResearcherModel : public QObject
bool hasEligibleProjects() const;
bool hasPoolProjects() const;
bool hasActiveBeacon() const;

//!
//! \brief hasPendingBeacon returns true if m_pending_beacon is not null and also not expired while pending.
//! \return boolean
//!
bool hasPendingBeacon() const;
bool hasRenewableBeacon() const;
bool beaconExpired() const;
Expand Down