mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
data rework
This commit is contained in:
@@ -24,9 +24,14 @@ export class StratumV1ClientStatistics {
|
||||
difficulty: targetDifficulty,
|
||||
});
|
||||
|
||||
// 10 min
|
||||
var coeff = 1000 * 60 * 10;
|
||||
var date = new Date();
|
||||
var rounded = new Date(Math.round(date.getTime() / coeff) * coeff);
|
||||
|
||||
await this.clientStatisticsService.save({
|
||||
time: new Date(),
|
||||
difficulty: targetDifficulty,
|
||||
time: rounded.getTime(),
|
||||
shares: targetDifficulty,
|
||||
address: client.address,
|
||||
clientName: client.clientName,
|
||||
sessionId: client.sessionId,
|
||||
|
||||
@@ -14,7 +14,7 @@ export class SubscriptionMessage extends StratumBaseMessage {
|
||||
@IsString()
|
||||
@MaxLength(128)
|
||||
@Transform(({ value, key, obj, type }) => {
|
||||
return obj.params[0] == null ? 'unknown' : SubscriptionMessage.refineUserAgent(obj.params);
|
||||
return obj.params[0] == null ? 'unknown' : SubscriptionMessage.refineUserAgent(obj.params[0]);
|
||||
})
|
||||
public userAgent: string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user