From 6c15f774b152346992b9b3035d92599a3589aa2d Mon Sep 17 00:00:00 2001 From: div72 Date: Sat, 23 Dec 2023 14:03:03 +0300 Subject: [PATCH] diag: add cpid check --- src/wallet/diagnose.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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;