Skip to content

Commit

Permalink
Ensure mintime is considered for jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Wilson committed Sep 27, 2024
1 parent 8ce057b commit 4282233
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/stratum-v1-jobs.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@ export class StratumV1JobsService {

this.lastIntervalCount = interval;

const currentTime = Math.floor(new Date().getTime() / 1000);
return {
version: blockTemplate.version,
bits: parseInt(blockTemplate.bits, 16),
prevHash: this.convertToLittleEndian(blockTemplate.previousblockhash),
transactions: blockTemplate.transactions.map(t => bitcoinjs.Transaction.fromHex(t.data)),
coinbasevalue: blockTemplate.coinbasevalue,
timestamp: Math.floor(new Date().getTime() / 1000),
timestamp: blockTemplate.mintime > currentTime ? blockTemplate.mintime : currentTime,
networkDifficulty: this.calculateNetworkDifficulty(parseInt(blockTemplate.bits, 16)),
clearJobs,
height: blockTemplate.height
Expand Down

0 comments on commit 4282233

Please sign in to comment.