Skip to content

Commit

Permalink
Merge pull request #2725 from div72/diag-fix2
Browse files Browse the repository at this point in the history
diag: fix researcher mode check
  • Loading branch information
jamescowens authored Dec 24, 2023
2 parents f44a4a5 + 6c15f77 commit 8874259
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/wallet/diagnose.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class Diagnose

m_hasEligibleProjects = researcher->Id().Which() == GRC::MiningId::Kind::CPID;
m_hasPoolProjects = researcher->Projects().ContainsPool();
m_researcher_mode = !(configured_for_investor_mode || (!m_hasEligibleProjects && m_hasPoolProjects));
m_researcher_mode = !(configured_for_investor_mode || (!m_hasEligibleProjects && !m_hasPoolProjects));
}

/**
Expand Down Expand Up @@ -532,15 +532,16 @@ class VerifyCPIDHasRAC : public Diagnose
*/

const GRC::BeaconRegistry& beacons = GRC::GetBeaconRegistry();
const GRC::CpidOption cpid = GRC::Researcher::Get()->Id().TryCpid();
if (const GRC::BeaconOption beacon = beacons.Try(*cpid)) {
if (!beacon->Expired(GetAdjustedTime())) {
return true;
}
for (const auto& beacon_ptr : beacons.FindPending(*cpid)) {
if (!beacon_ptr->Expired(GetAdjustedTime())) {
if (const GRC::CpidOption cpid = GRC::Researcher::Get()->Id().TryCpid()) {
if (const GRC::BeaconOption beacon = beacons.Try(*cpid)) {
if (!beacon->Expired(GetAdjustedTime())) {
return true;
}
for (const auto& beacon_ptr : beacons.FindPending(*cpid)) {
if (!beacon_ptr->Expired(GetAdjustedTime())) {
return true;
}
}
}
}
return false;
Expand Down

0 comments on commit 8874259

Please sign in to comment.