Skip to content

Commit

Permalink
Merge pull request #2698 from jamescowens/fix_expired_pending_beacon_…
Browse files Browse the repository at this point in the history
…display

gui: Fix expired pending beacon display
  • Loading branch information
jamescowens committed Sep 3, 2023
2 parents bbe73e5 + d79f431 commit b602677
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
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

0 comments on commit b602677

Please sign in to comment.