Skip to content

Commit

Permalink
Modify warning message for split CPID/mismatched email
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescowens committed Dec 18, 2021
1 parent e40a782 commit adef591
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
9 changes: 8 additions & 1 deletion src/gridcoin/researcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1219,8 +1219,15 @@ void Researcher::Reload(MiningProjectMap projects, GRC::BeaconError beacon_error

bool has_split_cpid = false;

if (const CpidOption cpid = mining_id.TryCpid()) {
// SplitCpid currently can occur if EITHER project have the right email but thed CPID is not converged, OR
// the email is mismatched between them or this client, or BOTH. Right now it is too hard to tease all of that
// out without significant replumbing. So instead if projects not empty run the DetectSplitCpid regardless
// of whether the mining_id has actually been populated.
if (!projects.empty()) {
has_split_cpid = DetectSplitCpid(projects);
}

if (const CpidOption cpid = mining_id.TryCpid()) {
LogPrintf("Selected primary CPID: %s", cpid->ToString());
} else if (!projects.empty()) {
LogPrintf("WARNING: no projects eligible for research rewards.");
Expand Down
20 changes: 14 additions & 6 deletions src/qt/researcher/researcherwizardsummarypage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or https://opensource.org/licenses/mit-license.php.

#include "logging.h"

#include "qt/bitcoinunits.h"
#include "qt/decoration.h"
#include "qt/forms/ui_researcherwizardsummarypage.h"
Expand Down Expand Up @@ -114,6 +116,7 @@ void ResearcherWizardSummaryPage::refreshOverallStatus()
const int icon_size = ui->overallStatusIconLabel->width();

QString status;
QString status_tooltip;
QIcon icon;

if (m_researcher_model->outOfSync()) {
Expand All @@ -125,21 +128,26 @@ void ResearcherWizardSummaryPage::refreshOverallStatus()
} else if (m_researcher_model->hasRenewableBeacon()) {
status = tr("Beacon renewal available.");
icon = QIcon(":/icons/warning");
} else if (m_researcher_model->hasSplitCpid()) {
status = tr("Split CPID or mismatched email.");
status_tooltip = tr("Your projects either refer to more than one CPID or your projects\' email do not match "
"what you used to configure Gridcoin here. Please ensure all of your projects are attached "
"using the same email address, the email address matches what was configured here, and if "
"you added a project recently, update that project and then all other projects using the "
"update button in the BOINC manager, then restart the client and recheck.");
icon = QIcon(":/icons/warning");
} else if (!m_researcher_model->hasMagnitude()) {
status = tr("Waiting for magnitude.");
icon = QIcon(":/icons/scraper_waiting_light");
} else if (m_researcher_model->hasSplitCpid()) {
status = tr("Likely split CPID - projects refer to more than one CPID. Please ensure all\n"
"of your projects are attached using the same email address and if you added\n"
"a project recently, update that project and then all other projects using the\n"
"update button in the BOINC manager, then go to the projects tab and refresh.");
icon = QIcon(":/icons/warning");
} else {
status = tr("Everything looks good.");
icon = QIcon(":/icons/round_green_check");
}

ui->overallStatusLabel->setText(status);

ui->overallStatusLabel->setToolTip(status_tooltip);

ui->overallStatusIconLabel->setPixmap(icon.pixmap(icon_size, icon_size));
}

Expand Down

0 comments on commit adef591

Please sign in to comment.