diff --git a/.env.example b/.env.example index 2b238d01..314e3ced 100644 --- a/.env.example +++ b/.env.example @@ -36,3 +36,6 @@ NETWORK=mainnet API_SECURE=false # Default is "Public-Pool", you can change it to any string it will be removed if it will make the block or coinbase script too big POOL_IDENTIFIER="Public-Pool" + +# Optional session difficulty (used as initial share diff) +SESSION_DIFFICULTY=30000 \ No newline at end of file diff --git a/src/models/StratumV1Client.ts b/src/models/StratumV1Client.ts index 0cb22077..a6cd4cb8 100644 --- a/src/models/StratumV1Client.ts +++ b/src/models/StratumV1Client.ts @@ -42,7 +42,8 @@ export class StratumV1Client { private statistics: StratumV1ClientStatistics; private stratumInitialized = false; private usedSuggestedDifficulty = false; - private sessionDifficulty: number = 16384; + private sessionDifficulty: number = + parseInt(process.env.SESSION_DIFFICULTY) || 16384; private entity: ClientEntity; private creatingEntity: Promise;