nerdminer

This commit is contained in:
Ben Wilson 2023-07-22 16:10:25 -04:00
parent c45d666cde
commit b9dc52ebc7
3 changed files with 4 additions and 5 deletions

View File

@ -294,8 +294,8 @@ export class StratumV1Client extends EasyUnsubscribe {
}
const now = Date.now();
const diffSeconds = (now - time.getTime()) / 1000;
// five minutes
if (diffSeconds > 5 * 60) {
// fifteen minutes
if (diffSeconds > 15 * 60) {
console.log('Watchdog ending session');
this.promiseSocket.socket.emit('end', true);
}

View File

@ -3,7 +3,7 @@ import { ClientEntity } from '../ORM/client/client.entity';
const CACHE_SIZE = 30;
const TARGET_SUBMISSION_PER_SECOND = 10;
const MIN_DIFF = 0.000001;
const MIN_DIFF = 1e-9;
export class StratumV1ClientStatistics {
private submissionCacheStart: Date;

View File

@ -76,8 +76,7 @@ export class StratumV1Service implements OnModuleInit {
await this.clientService.delete(client.extraNonceAndSessionId);
const clientCount = await this.clientService.connectedClientCount();
console.log(`Socket error:`, error);
console.log(`Client disconnected: ${promiseSocket.socket.remoteAddress}, ${client.extraNonceAndSessionId}, ${clientCount} total clients`);
console.log(`Client disconnected, socket error: ${promiseSocket.socket.remoteAddress}, ${client.extraNonceAndSessionId}, ${clientCount} total clients`);
});