mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2025-03-17 13:21:43 +01:00
share updates
This commit is contained in:
parent
e35bacc648
commit
29e0d884e3
@ -22,11 +22,6 @@ export class StratumV1ClientStatistics {
|
||||
}
|
||||
|
||||
|
||||
private async saveShares(client: ClientEntity) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
// We don't want to save them here because it can be DB intensive, stead do it every once in
|
||||
// awhile with saveShares()
|
||||
public async addShares(client: ClientEntity, targetDifficulty: number) {
|
||||
@ -45,12 +40,18 @@ export class StratumV1ClientStatistics {
|
||||
});
|
||||
|
||||
|
||||
|
||||
if (this.currentTimeSlot == null) {
|
||||
this.currentTimeSlot = timeSlot;
|
||||
}
|
||||
|
||||
if (this.currentTimeSlot != timeSlot) {
|
||||
await this.clientStatisticsService.insert({
|
||||
time: this.currentTimeSlot,
|
||||
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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user