diff --git a/src/wallet/diagnose.h b/src/wallet/diagnose.h index 3beff9c2bf..7286bd1ea4 100644 --- a/src/wallet/diagnose.h +++ b/src/wallet/diagnose.h @@ -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;