Skip to content

Commit 191a2dd

Browse files
authored
Merge pull request #2404 from scribblemaniac/select-active-cpid
researcher: Prefer CPID with active beacon for primary CPID
2 parents 744a5fb + c04720c commit 191a2dd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/gridcoin/researcher.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,12 @@ void Researcher::Reload(MiningProjectMap projects, GRC::BeaconError beacon_error
11951195

11961196
if (mining_id.Which() != MiningId::Kind::CPID) {
11971197
for (const auto& project_pair : projects) {
1198+
// Stop searching if the current mining_id already has an active beacon
1199+
const CpidOption cpid = mining_id.TryCpid();
1200+
if (cpid && GetBeaconRegistry().ContainsActive(*cpid)) {
1201+
break;
1202+
}
1203+
11981204
TryProjectCpid(mining_id, project_pair.second);
11991205
}
12001206
}

0 commit comments

Comments
 (0)