removed hash from client stats table, connection pool size

This commit is contained in:
Ben Wilson
2023-12-14 22:30:55 -05:00
parent ee5fea1df5
commit 83c769849d
4 changed files with 10 additions and 12 deletions
+1 -1
View File
@@ -505,7 +505,7 @@ export class StratumV1Client {
}
}
try {
await this.statistics.addSubmission(this.entity, submissionHash, this.sessionDifficulty);
await this.statistics.addSubmission(this.entity, this.sessionDifficulty);
await this.clientService.heartbeat(this.entity.address, this.entity.clientName, this.entity.sessionId, this.hashRate);
} catch (e) {
console.log(e);
+3 -4
View File
@@ -17,7 +17,7 @@ export class StratumV1ClientStatistics {
this.submissionCacheStart = new Date();
}
public async addSubmission(client: ClientEntity, submissionHash: string, targetDifficulty: number) {
public async addSubmission(client: ClientEntity, targetDifficulty: number) {
if (this.submissionCache.length > CACHE_SIZE) {
this.submissionCache.shift();
@@ -31,15 +31,14 @@ export class StratumV1ClientStatistics {
// 10 min
var coeff = 1000 * 60 * 10;
var date = new Date();
var rounded = new Date(Math.round(date.getTime() / coeff) * coeff);
var rounded = new Date(Math.floor(date.getTime() / coeff) * coeff);
await this.clientStatisticsService.save({
time: rounded.getTime(),
shares: targetDifficulty,
address: client.address,
clientName: client.clientName,
sessionId: client.sessionId,
submissionHash
sessionId: client.sessionId
});
}