Read best difficulty in API workers

This commit is contained in:
Ben
2026-06-21 17:45:00 -04:00
parent 12f3983c8f
commit 126b05224f
2 changed files with 29 additions and 3 deletions
+1 -3
View File
@@ -28,9 +28,7 @@ export class ClientController {
const workers = await this.getActiveAddressWorkers(address, mode);
const sessionSummaries = await this.shareAccountingService.getSessionSummaries(workers.map(worker => worker.clientId));
const addressSettings = process.env.API_ONLY === 'true'
? null
: await this.addressSettingsService.getSettings(address, false);
const addressSettings = await this.addressSettingsService.getSettings(address, false);
const bestDifficulty = addressSettings?.bestDifficulty ?? workers.reduce((best, worker) => {
return Math.max(best, Number(worker.bestDifficulty ?? 0));
}, 0);