Skip to content

Commit

Permalink
replace the address of known miners to their names.
Browse files Browse the repository at this point in the history
  • Loading branch information
hackmod committed Apr 18, 2018
1 parent bfe2cec commit a035722
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
20 changes: 20 additions & 0 deletions routes/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ var async = require('async');

var etherUnits = require(__lib + "etherUnits.js")

var config = {};
try {
config = require('../config.json');
} catch(e) {
if (e.code == 'MODULE_NOT_FOUND') {
console.log('No config file found. Using default configuration... (tools/config.json)');
config = require('../tools/config.json');
} else {
throw e;
process.exit(1);
}
}

module.exports = function(req, res) {

if (!("action" in req.body))
Expand Down Expand Up @@ -59,6 +72,13 @@ var getMinerStats = function(req, res) {
console.error(err);
res.status(500).send();
} else {
if (config.settings.miners) {
result.forEach(function(m) {
if (config.settings.miners[m._id]) {
m._id = config.settings.miners[m._id];
}
});
}
res.write(JSON.stringify(result));
res.end();
}
Expand Down
13 changes: 12 additions & 1 deletion tools/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
"symbol": "ETC",
"name": "Ethereum Classic",
"title": "Ethereum Classic Block Explorer",
"author": "Elaine"
"author": "Elaine",
"miners": {
"0xdf7d7e053933b5cc24372f878c90e62dadad5d42": "EtherMine",
"0xc91716199ccde49dc4fafaeb68925127ac80443f": "F2Pool",
"0x9eab4b0fc468a7f5d46228bf5a76cb52370d068d": "NanoPool",
"0x8c5535afdbdeea80adedc955420f684931bf91e0": "MiningPoolHub",
"0x4750e296949b747df1585aa67beee8be903dd560": "UUPool",
"0xef224fa5fad302b51f38898f4df499d7af127af0": "91pool",
"0x00d29bfdf5f8d2d0466da4b948f37692ca50867a": "2miners",
"0x4c2b4e716883a2c3f6b980b70b577e54b9441060": "ETCPool PL",
"0xd144e30a0571aaf0d0c050070ac435deba461fab": "Clona Network"
}
}
}

0 comments on commit a035722

Please sign in to comment.