From f39c0dc059bf98b80ec8cdba98a61df27d472428 Mon Sep 17 00:00:00 2001 From: Benjamin Wilson Date: Sat, 19 Apr 2025 13:50:50 -0400 Subject: [PATCH] Increase miner compatibility by allowing, but stripping unknown message values rather than rejecting as validation errors --- src/main.ts | 4 ++-- src/models/StratumV1Client.ts | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.ts b/src/main.ts index 9485205..514c703 100644 --- a/src/main.ts +++ b/src/main.ts @@ -33,8 +33,8 @@ async function bootstrap() { new ValidationPipe({ transform: true, whitelist: true, - forbidNonWhitelisted: true, - forbidUnknownValues: true + //forbidNonWhitelisted: true, + //forbidUnknownValues: true }), ); diff --git a/src/models/StratumV1Client.ts b/src/models/StratumV1Client.ts index 40dff42..17b5f83 100644 --- a/src/models/StratumV1Client.ts +++ b/src/models/StratumV1Client.ts @@ -132,7 +132,7 @@ export class StratumV1Client { const validatorOptions: ValidatorOptions = { whitelist: true, - forbidNonWhitelisted: true, + //forbidNonWhitelisted: true, }; const errors = await validate(subscriptionMessage, validatorOptions); @@ -176,7 +176,7 @@ export class StratumV1Client { const validatorOptions: ValidatorOptions = { whitelist: true, - forbidNonWhitelisted: true, + //forbidNonWhitelisted: true, }; const errors = await validate(configurationMessage, validatorOptions); @@ -214,7 +214,7 @@ export class StratumV1Client { const validatorOptions: ValidatorOptions = { whitelist: true, - forbidNonWhitelisted: true, + //forbidNonWhitelisted: true, }; const errors = await validate(authorizationMessage, validatorOptions); @@ -255,7 +255,7 @@ export class StratumV1Client { const validatorOptions: ValidatorOptions = { whitelist: true, - forbidNonWhitelisted: true, + //forbidNonWhitelisted: true, }; const errors = await validate(suggestDifficultyMessage, validatorOptions); @@ -300,7 +300,7 @@ export class StratumV1Client { const validatorOptions: ValidatorOptions = { whitelist: true, - forbidNonWhitelisted: true, + //forbidNonWhitelisted: true, }; const errors = await validate(miningSubmitMessage, validatorOptions);