Browse Source

Use blacklist to remove merged mined coins and other non equivalent mining systems

pull/15/head
Luke Childs 5 years ago
parent
commit
3785be3561
  1. 22
      js/coin-blacklist.js
  2. 29
      js/index.js

22
js/coin-blacklist.js

@ -1,4 +1,22 @@
export default [
'ARRR',
'HUSH3'
'DOGE',
'XDN',
'PPC',
'DGB', // We could actually support this if we merge the different algoriths
'DCY',
'DP',
'NLG',
'UNO',
'VIA',
'UBQ',
'GEO',
'XMY',
'FLO',
'FTC',
'PINK',
'CRW',
'MUE',
'XZC',
'ZEN',
'CANN'
];

29
js/index.js

@ -4,6 +4,7 @@ import {version} from '../package';
import getCoinSVGPath from './get-coin-svg-path';
import getCoinName from './get-coin-name';
import formatSeconds from './format-seconds';
import coinBlackList from './coin-blacklist';
import formatDollars from './format-dollars';
import formatHashrate from './format-hashrate';
@ -87,20 +88,22 @@ fetch('/api/data')
// Handle this
}
coins = coins.map(coin => {
const multiplier = (bitcoin.hashrateCostPerSecond / coin.hashrateCostPerSecond);
const workTime = (bitcoin.blockTimeInSeconds * BITOIN_CONFIRMATIONS * multiplier);
const confirmations = Math.ceil(workTime / coin.blockTimeInSeconds);
const timeForConfs = (coin.blockTimeInSeconds * confirmations);
coins = coins
.filter(coin => !coinBlackList.includes(coin.symbol))
.map(coin => {
const multiplier = (bitcoin.hashrateCostPerSecond / coin.hashrateCostPerSecond);
const workTime = (bitcoin.blockTimeInSeconds * BITOIN_CONFIRMATIONS * multiplier);
const confirmations = Math.ceil(workTime / coin.blockTimeInSeconds);
const timeForConfs = (coin.blockTimeInSeconds * confirmations);
return {
...coin,
multiplier,
workTime,
confirmations,
timeForConfs
};
});
return {
...coin,
multiplier,
workTime,
confirmations,
timeForConfs
};
});
render(coins);

Loading…
Cancel
Save