Merge pull request #6603 from mempool/natsoni/remove-stratum-jobs-ws
Some checks are pending
Backend Integration Tests with MariaDB / Backend Integration Tests - node 24.13.0 (push) Waiting to run
CI Pipeline for the Backend and Frontend / Backend (dev) - node 24.13.0 (push) Waiting to run
CI Pipeline for the Backend and Frontend / Backend (prod) - node 24.13.0 (push) Waiting to run
CI Pipeline for the Backend and Frontend / Cache assets for builds (push) Waiting to run
CI Pipeline for the Backend and Frontend / Frontend (dev) - node 24.13.0 (push) Blocked by required conditions
CI Pipeline for the Backend and Frontend / Frontend (prod) - node 24.13.0 (push) Blocked by required conditions
CI Pipeline for the Backend and Frontend / E2E tests for liquid (push) Blocked by required conditions
CI Pipeline for the Backend and Frontend / E2E tests for mempool (push) Blocked by required conditions
CI Pipeline for the Backend and Frontend / E2E tests for testnet4 (push) Blocked by required conditions
CI Pipeline for the Backend and Frontend / Validate generated backend Docker JSON (push) Waiting to run
Supply Chain Audit / Backend install-script audit (push) Waiting to run
Supply Chain Audit / Frontend install-script audit (push) Waiting to run

Send stratum jobs only when requested on stratum page
This commit is contained in:
mononaut 2026-06-30 17:30:11 +09:00 committed by GitHub
commit 6314bc1f54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 6 deletions

View file

@ -446,11 +446,11 @@ class WebsocketHandler {
delete client['track-mempool'];
}
if (parsedMessage && parsedMessage['track-stratum'] != null) {
if (parsedMessage && parsedMessage['track-stratum'] !== undefined) {
if (parsedMessage['track-stratum'] === 'all' || typeof parsedMessage['track-stratum'] === 'number') {
const sub = parsedMessage['track-stratum'];
client['track-stratum'] = sub;
response['stratumJobs'] = this.socketData['stratumJobs'];
response['stratumJobs'] = JSON.stringify(stratumApi.getJobs());
} else {
client['track-stratum'] = false;
}
@ -1369,8 +1369,6 @@ class WebsocketHandler {
}
public handleNewStratumJob(job: StratumJob): void {
this.updateSocketDataFields({ 'stratumJobs': stratumApi.getJobs() });
for (const server of this.webSocketServers) {
server.clients.forEach((client) => {
if (client.readyState !== WebSocket.OPEN) {

View file

@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, Inject, Input, LOCALE_ID, OnInit } from '@angular/core';
import { ChangeDetectionStrategy, Component, Inject, Input, LOCALE_ID, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { echarts, EChartsOption } from '@app/graphs/echarts';
import { BehaviorSubject, Observable, Subscription, combineLatest, of } from 'rxjs';
@ -26,7 +26,7 @@ interface AccelerationTotal {
standalone: false,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class PoolComponent implements OnInit {
export class PoolComponent implements OnInit, OnDestroy {
@Input() right: number | string = 45;
@Input() left: number | string = 75;
@ -365,5 +365,6 @@ export class PoolComponent implements OnInit {
ngOnDestroy(): void {
this.slugSubscription.unsubscribe();
this.websocketService.stopTrackStratum();
}
}