bug fixes

This commit is contained in:
Ben Wilson
2024-01-15 20:03:55 -05:00
parent 1d6670051f
commit 300fd99067
2 changed files with 5 additions and 4 deletions
+1
View File
@@ -21,6 +21,7 @@ export class AppController {
private readonly bitcoinRpcService: BitcoinRpcService
) { }
@Get('info')
public async info() {
+4 -4
View File
@@ -385,12 +385,12 @@ export class StratumV1Client {
let payoutInformation;
const devFeeAddress = this.configService.get('DEV_FEE_ADDRESS');
//50Th/s
this.noFee = devFeeAddress == null || devFeeAddress.length < 1;
if (this.noFee == false && this.entity) {
this.noFee = false;
if (this.entity) {
this.hashRate = await this.clientStatisticsService.getHashRateForSession(this.clientAuthorization.address, this.clientAuthorization.worker, this.extraNonceAndSessionId);
this.noFee = this.hashRate != 0 && this.hashRate < 50000000000000;
}
if (this.noFee) {
if (this.noFee || devFeeAddress == null || devFeeAddress.length < 1) {
payoutInformation = [
{ address: this.clientAuthorization.address, percent: 100 }
];
@@ -518,7 +518,7 @@ export class StratumV1Client {
await this.statistics.addShares(this.sessionDifficulty);
const now = new Date();
// only update every minute
if (now.getTime() - this.entity.updatedAt.getTime() > 1000 * 60) {
if (this.entity.updatedAt == null || now.getTime() - this.entity.updatedAt.getTime() > 1000 * 60) {
await this.clientService.heartbeat(this.entity.address, this.entity.clientName, this.entity.sessionId, this.hashRate, now);
this.entity.updatedAt = now;
}