From c3039bdf06bc93e9657f31f4502f77799c090836 Mon Sep 17 00:00:00 2001 From: mutatrum Date: Sat, 20 Jun 2026 16:42:32 +0200 Subject: [PATCH 1/3] Fix work received notification with SV2 --- .../axe-os/src/app/components/home/home.component.ts | 7 ++++--- main/http_server/axe-os/src/app/services/system.service.ts | 1 + main/http_server/openapi.yaml | 4 ++++ main/http_server/system_api_json.c | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/main/http_server/axe-os/src/app/components/home/home.component.ts b/main/http_server/axe-os/src/app/components/home/home.component.ts index 7c243f519..4f9ad2c56 100644 --- a/main/http_server/axe-os/src/app/components/home/home.component.ts +++ b/main/http_server/axe-os/src/app/components/home/home.component.ts @@ -108,7 +108,7 @@ export class HomeComponent implements OnInit, OnDestroy { private shareTimeout: any; private jobTimeout: any; private lastSharesCount: number = -1; - private lastScriptsig: string = ''; + private lastWorkReceived: number = -1; public systemInfoError$ = new BehaviorSubject({ duration: 0, @@ -922,12 +922,13 @@ export class HomeComponent implements OnInit, OnDestroy { } this.lastSharesCount = currentShares; - if (this.lastScriptsig !== '' && info.scriptsig !== this.lastScriptsig) { + const currentWorkReceived = info.workReceived ?? 0; + if (this.lastWorkReceived !== -1 && currentWorkReceived > this.lastWorkReceived) { this.flashJob = true; clearTimeout(this.jobTimeout); this.jobTimeout = setTimeout(() => this.flashJob = false, 500); } - this.lastScriptsig = info.scriptsig || ''; + this.lastWorkReceived = currentWorkReceived; }), map(info => { const formatted = { ...info }; diff --git a/main/http_server/axe-os/src/app/services/system.service.ts b/main/http_server/axe-os/src/app/services/system.service.ts index 3ecd26da2..8c65861ff 100644 --- a/main/http_server/axe-os/src/app/services/system.service.ts +++ b/main/http_server/axe-os/src/app/services/system.service.ts @@ -167,6 +167,7 @@ export class SystemApiService { coinbaseValueTotalSatoshis: 50, coinbaseValueUserSatoshis: 50, miningPaused: false, + workReceived: 42, } ).pipe(delay(1000)); } diff --git a/main/http_server/openapi.yaml b/main/http_server/openapi.yaml index bbf4c84b2..95d15c12c 100644 --- a/main/http_server/openapi.yaml +++ b/main/http_server/openapi.yaml @@ -206,6 +206,7 @@ components: - hashrateMonitor - miningPaused - statsLimit + - workReceived properties: ASICModel: type: string @@ -541,6 +542,9 @@ components: statsLimit: type: integer description: Maximum number of statistics data points + workReceived: + type: integer + description: Total number of mining jobs received from the pool SystemASIC: type: object diff --git a/main/http_server/system_api_json.c b/main/http_server/system_api_json.c index 8f9b95f18..1f8f708e0 100644 --- a/main/http_server/system_api_json.c +++ b/main/http_server/system_api_json.c @@ -69,6 +69,7 @@ static void system_api_add_telemetry(cJSON *root, GlobalState *g) { cJSON_AddFloatToObject(root, "responseTime", g->SYSTEM_MODULE.response_time); cJSON_AddNumberToObject(root, "responseShareBatch", g->SYSTEM_MODULE.response_share_batch); cJSON_AddFloatToObject(root, "processTime", g->SYSTEM_MODULE.process_time); + cJSON_AddNumberToObject(root, "workReceived", g->SYSTEM_MODULE.work_received); // Dynamic Block Info cJSON_AddNumberToObject(root, "blockFound", g->SYSTEM_MODULE.block_found); From 342d9a31f77905b7a723d98b89630d3c01b9374e Mon Sep 17 00:00:00 2001 From: mutatrum Date: Sat, 20 Jun 2026 16:58:00 +0200 Subject: [PATCH 2/3] Show share rejected notification on the dashboard --- .../app/components/home/home.component.html | 7 +++-- .../src/app/components/home/home.component.ts | 29 +++++++++++++------ 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/main/http_server/axe-os/src/app/components/home/home.component.html b/main/http_server/axe-os/src/app/components/home/home.component.html index 039034676..bfc6600e5 100644 --- a/main/http_server/axe-os/src/app/components/home/home.component.html +++ b/main/http_server/axe-os/src/app/components/home/home.component.html @@ -138,7 +138,10 @@
Shares - + + + +
{{info.sharesAccepted | number: '1.0-0'}} @@ -487,7 +490,7 @@

Block Header - + {{ signal }} diff --git a/main/http_server/axe-os/src/app/components/home/home.component.ts b/main/http_server/axe-os/src/app/components/home/home.component.ts index 4f9ad2c56..81bfaec93 100644 --- a/main/http_server/axe-os/src/app/components/home/home.component.ts +++ b/main/http_server/axe-os/src/app/components/home/home.component.ts @@ -103,11 +103,14 @@ export class HomeComponent implements OnInit, OnDestroy { public activePoolProtocol!: string; public responseTime!: number; - public flashShare: boolean = false; + public flashShareAccepted: boolean = false; + public flashShareRejected: boolean = false; public flashJob: boolean = false; - private shareTimeout: any; + private shareAcceptedTimeout: any; + private shareRejectedTimeout: any; private jobTimeout: any; - private lastSharesCount: number = -1; + private lastSharesAcceptedCount: number = -1; + private lastSharesRejectedCount: number = -1; private lastWorkReceived: number = -1; public systemInfoError$ = new BehaviorSubject({ @@ -914,13 +917,21 @@ export class HomeComponent implements OnInit, OnDestroy { } } - const currentShares = info.sharesAccepted + info.sharesRejected; - if (this.lastSharesCount !== -1 && currentShares > this.lastSharesCount) { - this.flashShare = true; - clearTimeout(this.shareTimeout); - this.shareTimeout = setTimeout(() => this.flashShare = false, 500); + const currentSharesAccepted = info.sharesAccepted; + if (this.lastSharesAcceptedCount !== -1 && currentSharesAccepted > this.lastSharesAcceptedCount) { + this.flashShareAccepted = true; + clearTimeout(this.shareAcceptedTimeout); + this.shareAcceptedTimeout = setTimeout(() => this.flashShareAccepted = false, 500); } - this.lastSharesCount = currentShares; + this.lastSharesAcceptedCount = currentSharesAccepted; + + const currentSharesRejected = info.sharesRejected; + if (this.lastSharesRejectedCount !== -1 && currentSharesRejected > this.lastSharesRejectedCount) { + this.flashShareRejected = true; + clearTimeout(this.shareRejectedTimeout); + this.shareRejectedTimeout = setTimeout(() => this.flashShareRejected = false, 500); + } + this.lastSharesRejectedCount = currentSharesRejected; const currentWorkReceived = info.workReceived ?? 0; if (this.lastWorkReceived !== -1 && currentWorkReceived > this.lastWorkReceived) { From f9f1906b7f94e74d3354120611c2079e0bb59c81 Mon Sep 17 00:00:00 2001 From: mutatrum Date: Sat, 20 Jun 2026 17:20:23 +0200 Subject: [PATCH 3/3] Consistent naming --- .../axe-os/src/app/components/home/home.component.html | 2 +- .../axe-os/src/app/components/home/home.component.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/main/http_server/axe-os/src/app/components/home/home.component.html b/main/http_server/axe-os/src/app/components/home/home.component.html index bfc6600e5..732622173 100644 --- a/main/http_server/axe-os/src/app/components/home/home.component.html +++ b/main/http_server/axe-os/src/app/components/home/home.component.html @@ -490,7 +490,7 @@

Block Header - + {{ signal }} diff --git a/main/http_server/axe-os/src/app/components/home/home.component.ts b/main/http_server/axe-os/src/app/components/home/home.component.ts index 81bfaec93..36d5efe37 100644 --- a/main/http_server/axe-os/src/app/components/home/home.component.ts +++ b/main/http_server/axe-os/src/app/components/home/home.component.ts @@ -105,10 +105,10 @@ export class HomeComponent implements OnInit, OnDestroy { public flashShareAccepted: boolean = false; public flashShareRejected: boolean = false; - public flashJob: boolean = false; + public flashWorkReceived: boolean = false; private shareAcceptedTimeout: any; private shareRejectedTimeout: any; - private jobTimeout: any; + private workReceivedTimeout: any; private lastSharesAcceptedCount: number = -1; private lastSharesRejectedCount: number = -1; private lastWorkReceived: number = -1; @@ -935,9 +935,9 @@ export class HomeComponent implements OnInit, OnDestroy { const currentWorkReceived = info.workReceived ?? 0; if (this.lastWorkReceived !== -1 && currentWorkReceived > this.lastWorkReceived) { - this.flashJob = true; - clearTimeout(this.jobTimeout); - this.jobTimeout = setTimeout(() => this.flashJob = false, 500); + this.flashWorkReceived = true; + clearTimeout(this.workReceivedTimeout); + this.workReceivedTimeout = setTimeout(() => this.flashWorkReceived = false, 500); } this.lastWorkReceived = currentWorkReceived; }),