Skip to content

Commit

Permalink
diag: add cpid check
Browse files Browse the repository at this point in the history
  • Loading branch information
div72 committed Dec 23, 2023
1 parent f22dd99 commit 6c15f77
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/wallet/diagnose.h
Original file line number Diff line number Diff line change
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 6c15f77

Please sign in to comment.