mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
set diff if it isn't suggested
This commit is contained in:
@@ -219,6 +219,11 @@ export class StratumV1Client extends EasyUnsubscribe {
|
|||||||
&& this.clientAuthorization != null
|
&& this.clientAuthorization != null
|
||||||
&& this.stratumInitialized == false) {
|
&& this.stratumInitialized == false) {
|
||||||
|
|
||||||
|
if (this.clientSuggestedDifficulty == null) {
|
||||||
|
const setDifficulty = JSON.stringify(new SuggestDifficulty().response(this.sessionDifficulty));
|
||||||
|
this.socket.write(setDifficulty + '\n')
|
||||||
|
}
|
||||||
|
|
||||||
this.stratumInitialized = true;
|
this.stratumInitialized = true;
|
||||||
|
|
||||||
this.entity = await this.clientService.save({
|
this.entity = await this.clientService.save({
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { eRequestMethod } from '../enums/eRequestMethod';
|
|||||||
|
|
||||||
export class StratumBaseMessage {
|
export class StratumBaseMessage {
|
||||||
@IsNumber()
|
@IsNumber()
|
||||||
id: number;
|
id?: number = null;
|
||||||
@IsEnum(eRequestMethod)
|
@IsEnum(eRequestMethod)
|
||||||
method: eRequestMethod;
|
method: eRequestMethod;
|
||||||
}
|
}
|
||||||
@@ -20,8 +20,7 @@ export class SubscriptionMessage extends StratumBaseMessage {
|
|||||||
error: null,
|
error: null,
|
||||||
result: [
|
result: [
|
||||||
[
|
[
|
||||||
['mining.set_difficulty', '731ec5e0649606ff'],
|
['mining.notify', clientId]
|
||||||
['mining.notify', '731ec5e0649606ff']
|
|
||||||
],
|
],
|
||||||
clientId, //Extranonce1 - Hex-encoded, per-connection unique string which will be used for coinbase serialization later. Keep it safe!
|
clientId, //Extranonce1 - Hex-encoded, per-connection unique string which will be used for coinbase serialization later. Keep it safe!
|
||||||
4 //Extranonce2_size - Represents expected length of extranonce2 which will be generated by the miner.
|
4 //Extranonce2_size - Represents expected length of extranonce2 which will be generated by the miner.
|
||||||
|
|||||||
Reference in New Issue
Block a user