mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 17:15:03 -07:00
back port some changes from postgres
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user