diff --git a/.env.example b/.env.example index 010ae42..50b3453 100644 --- a/.env.example +++ b/.env.example @@ -8,12 +8,14 @@ BITCOIN_RPC_TIMEOUT=10000 PORT=3333 #optional telegram bot -TELEGRAM_BOT_TOKEN= +#TELEGRAM_BOT_TOKEN= #optional discord bot -DISCORD_BOT_CLIENTID= -DISCORD_BOT_GUILD_ID= -DISCORD_BOT_CHANNEL_ID= +#DISCORD_BOT_CLIENTID= +#DISCORD_BOT_GUILD_ID= +#DISCORD_BOT_CHANNEL_ID= +#optional DEV_FEE_ADDRESS= +# mainnet | testnet NETWORK=mainnet \ No newline at end of file diff --git a/src/models/StratumV1Client.ts b/src/models/StratumV1Client.ts index 81783a2..98b3ed2 100644 --- a/src/models/StratumV1Client.ts +++ b/src/models/StratumV1Client.ts @@ -309,16 +309,17 @@ export class StratumV1Client extends EasyUnsubscribe { const hashRate = await this.clientStatisticsService.getHashRateForSession(this.clientAuthorization.address, this.clientAuthorization.worker, this.extraNonceAndSessionId); let payoutInformation; + const devFeeAddress = this.configService.get('DEV_FEE_ADDRESS'); //50Th/s const noFee = hashRate < 50000000000000; - if (noFee) { + if (noFee || devFeeAddress == null || devFeeAddress.length < 1) { payoutInformation = [ { address: this.clientAuthorization.address, percent: 100 } ]; } else { payoutInformation = [ - { address: this.configService.get('DEV_FEE_ADDRESS'), percent: 1.5 }, + { address: devFeeAddress, percent: 1.5 }, { address: this.clientAuthorization.address, percent: 98.5 } ]; }