Skip to content
Permalink
Browse files

Better handle developer donations

- Fix setting 0% donation
- Fix/Improve logging for donation
  • Loading branch information
croniccorey committed Nov 25, 2019
1 parent 6dec6bd commit cfe1389e8de43c0bb11387c003a5b3d564102539
Showing with 11 additions and 8 deletions.
  1. +4 −0 init.js
  2. +0 −3 lib/blockUnlocker.js
  3. +7 −5 lib/configReader.js
@@ -64,6 +64,10 @@ require('./lib/exceptionWriter.js')(logSystem);

// Pool informations
log('info', logSystem, 'Starting Cryptonote Node.JS pool version %s', [version]);

// Developer donations
if (devFee < 0.2)
log('info', logSystem, 'Developer donation \(devDonation\) is set to %d\%, Please consider raising it to 0.2\% or higher !!!', [devFee]);

// Run a single module ?
var singleModule = (function(){
@@ -219,15 +219,12 @@ function runInterval(){
].join(':')])

let feePercent = config.blockUnlocker.poolFee / 100
let devPercent = config.blockUnlocker.devDonation || 0.2;

if (Object.keys(donations).length) {
for(let wallet in donations) {
let percent = donations[wallet] / 100
feePercent += percent
payments[wallet] = Math.round(block.reward * percent)
if (devPercent < 0.2)
log('info', logSystem, 'Your Dev donation is set to %d\%. Please consider raising donation to 0.2\% or higher !!!', devPercent);
log('info', logSystem, 'Block %d donation to %s as %d percent of reward: %d', [block.height, wallet, percent, payments[wallet]])
}
}
@@ -114,8 +114,10 @@ let donationAddresses = {

global.donations = {};

let percent = config.blockUnlocker.devDonation || 0.2;;
let wallet = donationAddresses[config.symbol];
if (percent && wallet) {
global.donations[wallet] = percent;
}
global.devFee = config.blockUnlocker.devDonation || 0.2;
if (config.blockUnlocker.devDonation === 0)
global.devFee = 0;

let wallet = donationAddresses[config.symbol.toUpperCase()];
if (devFee && wallet)
global.donations[wallet] = devFee;

0 comments on commit cfe1389

Please sign in to comment.
You can’t perform that action at this time.