Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Wilson committed Jan 16, 2024
1 parent 1d66700 commit 300fd99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class AppController {
private readonly bitcoinRpcService: BitcoinRpcService
) { }

@Get('info')
public async info() {


Expand Down
8 changes: 4 additions & 4 deletions src/models/StratumV1Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
];
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 300fd99

Please sign in to comment.