mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
share updates
This commit is contained in:
@@ -44,12 +44,18 @@ export class StratumV1ClientStatistics {
|
||||
|
||||
if (this.currentTimeSlot == null) {
|
||||
this.currentTimeSlot = timeSlot;
|
||||
}
|
||||
|
||||
if (this.currentTimeSlot != timeSlot) {
|
||||
await this.clientStatisticsService.insert({
|
||||
time: this.currentTimeSlot,
|
||||
clientId: client.id,
|
||||
shares: this.shares,
|
||||
acceptedCount: this.acceptedCount,
|
||||
address: client.address,
|
||||
clientName: client.clientName,
|
||||
sessionId: client.sessionId
|
||||
});
|
||||
this.lastSave = new Date().getTime();
|
||||
} else if (this.currentTimeSlot != timeSlot) {
|
||||
await this.clientStatisticsService.insert({
|
||||
time: this.currentTimeSlot,
|
||||
shares: this.shares,
|
||||
acceptedCount: this.acceptedCount,
|
||||
address: client.address,
|
||||
@@ -62,7 +68,6 @@ export class StratumV1ClientStatistics {
|
||||
} else if ((date.getTime() - 60 * 1000) > this.lastSave) {
|
||||
await this.clientStatisticsService.update({
|
||||
time: this.currentTimeSlot,
|
||||
clientId: client.id,
|
||||
shares: this.shares,
|
||||
acceptedCount: this.acceptedCount,
|
||||
address: client.address,
|
||||
|
||||
Reference in New Issue
Block a user