mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 09:05:06 -07:00
bug fixes
This commit is contained in:
@@ -21,6 +21,7 @@ export class AppController {
|
|||||||
private readonly bitcoinRpcService: BitcoinRpcService
|
private readonly bitcoinRpcService: BitcoinRpcService
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
|
@Get('info')
|
||||||
public async info() {
|
public async info() {
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -385,12 +385,12 @@ export class StratumV1Client {
|
|||||||
let payoutInformation;
|
let payoutInformation;
|
||||||
const devFeeAddress = this.configService.get('DEV_FEE_ADDRESS');
|
const devFeeAddress = this.configService.get('DEV_FEE_ADDRESS');
|
||||||
//50Th/s
|
//50Th/s
|
||||||
this.noFee = devFeeAddress == null || devFeeAddress.length < 1;
|
this.noFee = false;
|
||||||
if (this.noFee == false && this.entity) {
|
if (this.entity) {
|
||||||
this.hashRate = await this.clientStatisticsService.getHashRateForSession(this.clientAuthorization.address, this.clientAuthorization.worker, this.extraNonceAndSessionId);
|
this.hashRate = await this.clientStatisticsService.getHashRateForSession(this.clientAuthorization.address, this.clientAuthorization.worker, this.extraNonceAndSessionId);
|
||||||
this.noFee = this.hashRate != 0 && this.hashRate < 50000000000000;
|
this.noFee = this.hashRate != 0 && this.hashRate < 50000000000000;
|
||||||
}
|
}
|
||||||
if (this.noFee) {
|
if (this.noFee || devFeeAddress == null || devFeeAddress.length < 1) {
|
||||||
payoutInformation = [
|
payoutInformation = [
|
||||||
{ address: this.clientAuthorization.address, percent: 100 }
|
{ address: this.clientAuthorization.address, percent: 100 }
|
||||||
];
|
];
|
||||||
@@ -518,7 +518,7 @@ export class StratumV1Client {
|
|||||||
await this.statistics.addShares(this.sessionDifficulty);
|
await this.statistics.addShares(this.sessionDifficulty);
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
// only update every minute
|
// 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);
|
await this.clientService.heartbeat(this.entity.address, this.entity.clientName, this.entity.sessionId, this.hashRate, now);
|
||||||
this.entity.updatedAt = now;
|
this.entity.updatedAt = now;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user