cleanup and support for all address types

This commit is contained in:
Ben Wilson
2023-06-26 20:52:00 -04:00
parent 5ec2906f99
commit a435a9bbd8
15 changed files with 253 additions and 31 deletions
@@ -19,6 +19,17 @@ export class ClientStatisticsService {
return await this.clientStatisticsRepository.save(clientStatistic);
}
public async deleteOldStatistics() {
const oneDayAgo = new Date(Date.now() - 24 * 60 * 60 * 1000);
return await this.clientStatisticsRepository
.createQueryBuilder()
.delete()
.from(ClientStatisticsEntity)
.where('time < :time', { time: oneDayAgo })
.execute();
}
public async getHashRateForAddress(address: string) {
const query = `