mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
nerdminer
This commit is contained in:
@@ -294,8 +294,8 @@ export class StratumV1Client extends EasyUnsubscribe {
|
|||||||
}
|
}
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
const diffSeconds = (now - time.getTime()) / 1000;
|
const diffSeconds = (now - time.getTime()) / 1000;
|
||||||
// five minutes
|
// fifteen minutes
|
||||||
if (diffSeconds > 5 * 60) {
|
if (diffSeconds > 15 * 60) {
|
||||||
console.log('Watchdog ending session');
|
console.log('Watchdog ending session');
|
||||||
this.promiseSocket.socket.emit('end', true);
|
this.promiseSocket.socket.emit('end', true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { ClientEntity } from '../ORM/client/client.entity';
|
|||||||
|
|
||||||
const CACHE_SIZE = 30;
|
const CACHE_SIZE = 30;
|
||||||
const TARGET_SUBMISSION_PER_SECOND = 10;
|
const TARGET_SUBMISSION_PER_SECOND = 10;
|
||||||
const MIN_DIFF = 0.000001;
|
const MIN_DIFF = 1e-9;
|
||||||
export class StratumV1ClientStatistics {
|
export class StratumV1ClientStatistics {
|
||||||
|
|
||||||
private submissionCacheStart: Date;
|
private submissionCacheStart: Date;
|
||||||
|
|||||||
@@ -76,8 +76,7 @@ export class StratumV1Service implements OnModuleInit {
|
|||||||
await this.clientService.delete(client.extraNonceAndSessionId);
|
await this.clientService.delete(client.extraNonceAndSessionId);
|
||||||
|
|
||||||
const clientCount = await this.clientService.connectedClientCount();
|
const clientCount = await this.clientService.connectedClientCount();
|
||||||
console.log(`Socket error:`, error);
|
console.log(`Client disconnected, socket error: ${promiseSocket.socket.remoteAddress}, ${client.extraNonceAndSessionId}, ${clientCount} total clients`);
|
||||||
console.log(`Client disconnected: ${promiseSocket.socket.remoteAddress}, ${client.extraNonceAndSessionId}, ${clientCount} total clients`);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user