optional DEV_FEE_ADDRESS

This commit is contained in:
Ben Wilson
2023-07-25 09:26:52 -04:00
parent b300b82130
commit 59ccc2cf2c
2 changed files with 9 additions and 6 deletions
+6 -4
View File
@@ -8,12 +8,14 @@ BITCOIN_RPC_TIMEOUT=10000
PORT=3333 PORT=3333
#optional telegram bot #optional telegram bot
TELEGRAM_BOT_TOKEN= #TELEGRAM_BOT_TOKEN=
#optional discord bot #optional discord bot
DISCORD_BOT_CLIENTID= #DISCORD_BOT_CLIENTID=
DISCORD_BOT_GUILD_ID= #DISCORD_BOT_GUILD_ID=
DISCORD_BOT_CHANNEL_ID= #DISCORD_BOT_CHANNEL_ID=
#optional
DEV_FEE_ADDRESS= DEV_FEE_ADDRESS=
# mainnet | testnet
NETWORK=mainnet NETWORK=mainnet
+3 -2
View File
@@ -309,16 +309,17 @@ export class StratumV1Client extends EasyUnsubscribe {
const hashRate = await this.clientStatisticsService.getHashRateForSession(this.clientAuthorization.address, this.clientAuthorization.worker, this.extraNonceAndSessionId); const hashRate = await this.clientStatisticsService.getHashRateForSession(this.clientAuthorization.address, this.clientAuthorization.worker, this.extraNonceAndSessionId);
let payoutInformation; let payoutInformation;
const devFeeAddress = this.configService.get('DEV_FEE_ADDRESS');
//50Th/s //50Th/s
const noFee = hashRate < 50000000000000; const noFee = hashRate < 50000000000000;
if (noFee) { if (noFee || devFeeAddress == null || devFeeAddress.length < 1) {
payoutInformation = [ payoutInformation = [
{ address: this.clientAuthorization.address, percent: 100 } { address: this.clientAuthorization.address, percent: 100 }
]; ];
} else { } else {
payoutInformation = [ payoutInformation = [
{ address: this.configService.get('DEV_FEE_ADDRESS'), percent: 1.5 }, { address: devFeeAddress, percent: 1.5 },
{ address: this.clientAuthorization.address, percent: 98.5 } { address: this.clientAuthorization.address, percent: 98.5 }
]; ];
} }