Browse Source

Merge branch 'master' into master

master
Dan Janosik 5 years ago
committed by GitHub
parent
commit
85d8362e7c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      CHANGELOG.md
  2. 63
      app.js
  3. 20
      app/api/coreApi.js
  4. 4
      app/api/electrumAddressApi.js
  5. 10
      app/api/rpcApi.js
  6. 149
      app/coins/btc.js
  7. 4
      app/utils.js
  8. 643
      npm-shrinkwrap.json
  9. 31
      package.json
  10. 70
      public/txt/mining-pools-configs/BTC/0.json
  11. 64
      public/txt/mining-pools-configs/BTC/1.json
  12. 134
      public/txt/mining-pools-configs/LTC/0.json
  13. 4
      routes/baseActionsRouter.js
  14. 1
      views/fun.pug
  15. 2
      views/includes/block-content.pug
  16. 2
      views/includes/transaction-io-details.pug
  17. 6
      views/layout.pug
  18. 6
      views/peers.pug
  19. 4
      views/transaction.pug

10
CHANGELOG.md

@ -1,5 +1,13 @@
#### Pending Release #### v1.1.4
###### 2019-12-04
* First-class support for testnet/regtest
#### v1.1.3
###### 2019-12-02
* Fixes related to running bitcoind 0.19.0.1
* Updated dependencies
* Version number in footer * Version number in footer
* `/changelog` linked in footer * `/changelog` linked in footer

63
app.js

@ -152,6 +152,32 @@ function loadChangelog() {
}); });
} }
function loadHistoricalDataForChain(chain) {
global.specialTransactions = {};
global.specialBlocks = {};
global.specialAddresses = {};
if (config.donations.addresses && config.donations.addresses[coinConfig.ticker]) {
global.specialAddresses[config.donations.addresses[coinConfig.ticker].address] = {type:"donation"};
}
if (global.coinConfig.historicalData) {
global.coinConfig.historicalData.forEach(function(item) {
if (item.chain == chain) {
if (item.type == "blockheight") {
global.specialBlocks[item.blockHash] = item;
} else if (item.type == "tx") {
global.specialTransactions[item.txid] = item;
} else if (item.type == "address") {
global.specialAddresses[item.address] = {type:"fun", addressInfo:item};
}
}
});
}
}
app.onStartup = function() { app.onStartup = function() {
global.config = config; global.config = config;
@ -209,8 +235,20 @@ app.continueStartup = function() {
global.rpcClientNoTimeout = new bitcoinCore(rpcClientNoTimeoutProperties); global.rpcClientNoTimeout = new bitcoinCore(rpcClientNoTimeoutProperties);
coreApi.getNetworkInfo().then(function(getnetworkinfo) { coreApi.getNetworkInfo().then(function(getnetworkinfo) {
debugLog(`Connected via RPC to node. Basic info: version=${getnetworkinfo.version}, subversion=${getnetworkinfo.subversion}, protocolversion=${getnetworkinfo.protocolversion}, services=${getnetworkinfo.localservices}`); coreApi.getBlockchainInfo().then(function(getblockchaininfo) {
global.activeBlockchain = getblockchaininfo.chain;
// localservicenames introduced in 0.19
var services = getnetworkinfo.localservicesnames ? ("[" + getnetworkinfo.localservicesnames.join(", ") + "]") : getnetworkinfo.localservices;
debugLog(`RPC Connected: version=${getnetworkinfo.version} (${getnetworkinfo.subversion}), protocolversion=${getnetworkinfo.protocolversion}, chain=${getblockchaininfo.chain}, services=${services}`);
// load historical/fun items for this chain
loadHistoricalDataForChain(global.activeBlockchain);
}).catch(function(err) {
utils.logError("329u0wsdgewg6ed", err);
});
}).catch(function(err) { }).catch(function(err) {
utils.logError("32ugegdfsde", err); utils.logError("32ugegdfsde", err);
}); });
@ -229,27 +267,6 @@ app.continueStartup = function() {
}); });
} }
global.specialTransactions = {};
global.specialBlocks = {};
global.specialAddresses = {};
if (config.donations.addresses && config.donations.addresses[coinConfig.ticker]) {
global.specialAddresses[config.donations.addresses[coinConfig.ticker].address] = {type:"donation"};
}
if (global.coinConfig.historicalData) {
global.coinConfig.historicalData.forEach(function(item) {
if (item.type == "blockheight") {
global.specialBlocks[item.blockHash] = item;
} else if (item.type == "tx") {
global.specialTransactions[item.txid] = item;
} else if (item.type == "address") {
global.specialAddresses[item.address] = {type:"fun", addressInfo:item};
}
});
}
if (config.addressApi) { if (config.addressApi) {
var supportedAddressApis = addressApi.getSupportedAddressApis(); var supportedAddressApis = addressApi.getSupportedAddressApis();
@ -280,12 +297,14 @@ app.continueStartup = function() {
setInterval(getSourcecodeProjectMetadata, 3600000); setInterval(getSourcecodeProjectMetadata, 3600000);
} }
if (global.activeBlockchain == "main") {
if (global.exchangeRates == null) { if (global.exchangeRates == null) {
utils.refreshExchangeRates(); utils.refreshExchangeRates();
} }
// refresh exchange rate periodically // refresh exchange rate periodically
setInterval(utils.refreshExchangeRates, 1800000); setInterval(utils.refreshExchangeRates, 1800000);
}
utils.logMemoryUsage(); utils.logMemoryUsage();
setInterval(utils.logMemoryUsage, 5000); setInterval(utils.logMemoryUsage, 5000);

20
app/api/coreApi.js

@ -74,11 +74,11 @@ if (redisCache.active) {
function getGenesisBlockHash() { function getGenesisBlockHash() {
return coins[config.coin].genesisBlockHash; return coins[config.coin].genesisBlockHashesByNetwork[global.activeBlockchain];
} }
function getGenesisCoinbaseTransactionId() { function getGenesisCoinbaseTransactionId() {
return coins[config.coin].genesisCoinbaseTransactionId; return coins[config.coin].genesisCoinbaseTransactionIdsByNetwork[global.activeBlockchain];
} }
@ -394,16 +394,16 @@ function getMempoolStats() {
for (var txid in result) { for (var txid in result) {
var txMempoolInfo = result[txid]; var txMempoolInfo = result[txid];
var fee = txMempoolInfo.modifiedfee; var fee = txMempoolInfo.modifiedfee;
var feePerByte = txMempoolInfo.modifiedfee / txMempoolInfo.size; var size = txMempoolInfo.vsize ? txMempoolInfo.vsize : txMempoolInfo.size;
var feePerByte = txMempoolInfo.modifiedfee / size;
var age = Date.now() / 1000 - txMempoolInfo.time; var age = Date.now() / 1000 - txMempoolInfo.time;
var size = txMempoolInfo.size;
if (fee > maxFee) { if (fee > maxFee) {
maxFee = txMempoolInfo.modifiedfee; maxFee = txMempoolInfo.modifiedfee;
} }
if (feePerByte > maxFeePerByte) { if (feePerByte > maxFeePerByte) {
maxFeePerByte = txMempoolInfo.modifiedfee / txMempoolInfo.size; maxFeePerByte = txMempoolInfo.modifiedfee / size;
} }
ages.push({age:age, txid:txid}); ages.push({age:age, txid:txid});
@ -506,17 +506,17 @@ function getMempoolStats() {
for (var txid in result) { for (var txid in result) {
var txMempoolInfo = result[txid]; var txMempoolInfo = result[txid];
var fee = txMempoolInfo.modifiedfee; var fee = txMempoolInfo.modifiedfee;
var feePerByte = txMempoolInfo.modifiedfee / txMempoolInfo.size; var size = txMempoolInfo.vsize ? txMempoolInfo.vsize : txMempoolInfo.size;
var feePerByte = txMempoolInfo.modifiedfee / size;
var satoshiPerByte = feePerByte * 100000000; var satoshiPerByte = feePerByte * 100000000;
var age = Date.now() / 1000 - txMempoolInfo.time; var age = Date.now() / 1000 - txMempoolInfo.time;
var size = txMempoolInfo.size;
var addedToBucket = false; var addedToBucket = false;
for (var i = 0; i < satoshiPerByteBucketMaxima.length; i++) { for (var i = 0; i < satoshiPerByteBucketMaxima.length; i++) {
if (satoshiPerByteBucketMaxima[i] > satoshiPerByte) { if (satoshiPerByteBucketMaxima[i] > satoshiPerByte) {
satoshiPerByteBuckets[i]["count"]++; satoshiPerByteBuckets[i]["count"]++;
satoshiPerByteBuckets[i]["totalFees"] += fee; satoshiPerByteBuckets[i]["totalFees"] += fee;
satoshiPerByteBuckets[i]["totalBytes"] += txMempoolInfo.size; satoshiPerByteBuckets[i]["totalBytes"] += size;
addedToBucket = true; addedToBucket = true;
@ -527,12 +527,12 @@ function getMempoolStats() {
if (!addedToBucket) { if (!addedToBucket) {
satoshiPerByteBuckets[bucketCount - 1]["count"]++; satoshiPerByteBuckets[bucketCount - 1]["count"]++;
satoshiPerByteBuckets[bucketCount - 1]["totalFees"] += fee; satoshiPerByteBuckets[bucketCount - 1]["totalFees"] += fee;
satoshiPerByteBuckets[bucketCount - 1]["totalBytes"] += txMempoolInfo.size; satoshiPerByteBuckets[bucketCount - 1]["totalBytes"] += size;
} }
summary["count"]++; summary["count"]++;
summary["totalFees"] += txMempoolInfo.modifiedfee; summary["totalFees"] += txMempoolInfo.modifiedfee;
summary["totalBytes"] += txMempoolInfo.size; summary["totalBytes"] += size;
var ageBucketIndex = Math.min(ageBucketCount - 1, parseInt(age / (maxAge / ageBucketCount))); var ageBucketIndex = Math.min(ageBucketCount - 1, parseInt(age / (maxAge / ageBucketCount)));
var sizeBucketIndex = Math.min(sizeBucketCount - 1, parseInt(size / (maxSize / sizeBucketCount))); var sizeBucketIndex = Math.min(sizeBucketCount - 1, parseInt(size / (maxSize / sizeBucketCount)));

4
app/api/electrumAddressApi.js

@ -172,7 +172,7 @@ function getAddressTxids(addrScripthash) {
if (addrScripthash == coinConfig.genesisCoinbaseOutputAddressScripthash) { if (addrScripthash == coinConfig.genesisCoinbaseOutputAddressScripthash) {
for (var i = 0; i < results.length; i++) { for (var i = 0; i < results.length; i++) {
results[i].result.unshift({tx_hash:coinConfig.genesisCoinbaseTransactionId, height:0}); results[i].result.unshift({tx_hash:coinConfig.genesisCoinbaseTransactionIdsByNetwork[global.activeBlockchain], height:0});
} }
} }
@ -206,7 +206,7 @@ function getAddressBalance(addrScripthash) {
if (addrScripthash == coinConfig.genesisCoinbaseOutputAddressScripthash) { if (addrScripthash == coinConfig.genesisCoinbaseOutputAddressScripthash) {
for (var i = 0; i < results.length; i++) { for (var i = 0; i < results.length; i++) {
var coinbaseBlockReward = coinConfig.blockRewardFunction(0); var coinbaseBlockReward = coinConfig.blockRewardFunction(0, global.activeBlockchain);
results[i].result.confirmed += (coinbaseBlockReward * coinConfig.baseCurrencyUnit.multiplier); results[i].result.confirmed += (coinbaseBlockReward * coinConfig.baseCurrencyUnit.multiplier);
} }

10
app/api/rpcApi.js

@ -150,12 +150,18 @@ function getRawTransaction(txid) {
debugLog("getRawTransaction: %s", txid); debugLog("getRawTransaction: %s", txid);
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
if (coins[config.coin].genesisCoinbaseTransactionId && txid == coins[config.coin].genesisCoinbaseTransactionId) { if (coins[config.coin].genesisCoinbaseTransactionIdsByNetwork[global.activeBlockchain] && txid == coins[config.coin].genesisCoinbaseTransactionIdsByNetwork[global.activeBlockchain]) {
// copy the "confirmations" field from genesis block to the genesis-coinbase tx // copy the "confirmations" field from genesis block to the genesis-coinbase tx
getBlockchainInfo().then(function(blockchainInfoResult) { getBlockchainInfo().then(function(blockchainInfoResult) {
var result = coins[config.coin].genesisCoinbaseTransaction; var result = coins[config.coin].genesisCoinbaseTransactionsByNetwork[global.activeBlockchain];
result.confirmations = blockchainInfoResult.blocks; result.confirmations = blockchainInfoResult.blocks;
// hack: default regtest node returns "0" for number of blocks, despite including a genesis block;
// to display this block without errors, tag it with 1 confirmation
if (global.activeBlockchain == "regtest" && result.confirmations == 0) {
result.confirmations = 1;
}
resolve(result); resolve(result);
}).catch(function(err) { }).catch(function(err) {

149
app/coins/btc.js

@ -69,9 +69,18 @@ module.exports = {
baseCurrencyUnit:currencyUnits[3], baseCurrencyUnit:currencyUnits[3],
defaultCurrencyUnit:currencyUnits[0], defaultCurrencyUnit:currencyUnits[0],
feeSatoshiPerByteBucketMaxima: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 50, 75, 100, 150], feeSatoshiPerByteBucketMaxima: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 50, 75, 100, 150],
genesisBlockHash: "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f", genesisBlockHashesByNetwork:{
genesisCoinbaseTransactionId: "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b", "main": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
genesisCoinbaseTransaction: { "test": "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943",
"regtest": "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206"
},
genesisCoinbaseTransactionIdsByNetwork: {
"main": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"test": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"regtest": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"
},
genesisCoinbaseTransactionsByNetwork:{
"main": {
"hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0804ffff001d02fd04ffffffff0100f2052a01000000434104f5eeb2b10c944c6b9fbcfff94c35bdeecd93df977882babc7f3a2cf7f5c81d3b09a68db7f0e04f21de5d4230e75e6dbe7ad16eefe0d4325a62067dc6f369446aac00000000", "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0804ffff001d02fd04ffffffff0100f2052a01000000434104f5eeb2b10c944c6b9fbcfff94c35bdeecd93df977882babc7f3a2cf7f5c81d3b09a68db7f0e04f21de5d4230e75e6dbe7ad16eefe0d4325a62067dc6f369446aac00000000",
"txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b", "txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"hash": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b", "hash": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
@ -104,11 +113,77 @@ module.exports = {
"time": 1230988505, "time": 1230988505,
"blocktime": 1230988505 "blocktime": 1230988505
}, },
"test": {
"hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
"txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"hash": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"version": 1,
"size": 204,
"vsize": 204,
"weight": 816,
"locktime": 0,
"vin": [
{
"coinbase": "04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73",
"sequence": 4294967295
}
],
"vout": [
{
"value": 50.00000000,
"n": 0,
"scriptPubKey": {
"asm": "04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f OP_CHECKSIG",
"hex": "4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac",
"reqSigs": 1,
"type": "pubkey",
"addresses": [
"mpXwg4jMtRhuSpVq4xS3HFHmCmWp9NyGKt"
]
}
}
],
"blockhash": "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943",
"time": 1296688602,
"blocktime": 1296688602
},
"regtest": {
"hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
"txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"hash": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"version": 1,
"size": 204,
"vsize": 204,
"weight": 816,
"locktime": 0,
"vin": [
{
"coinbase": "04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73",
"sequence": 4294967295
}
],
"vout": [
{
"value": 50.00000000,
"n": 0,
"scriptPubKey": {
"asm": "04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f OP_CHECKSIG",
"hex": "4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac",
"type": "pubkey"
}
}
],
"blockhash": "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206",
"time": 1296688602,
"blocktime": 1296688602
}
},
genesisCoinbaseOutputAddressScripthash:"8b01df4e368ea28f8dc0423bcf7a4923e3a12d307c875e47a0cfbf90b5c39161", genesisCoinbaseOutputAddressScripthash:"8b01df4e368ea28f8dc0423bcf7a4923e3a12d307c875e47a0cfbf90b5c39161",
historicalData: [ historicalData: [
{ {
type: "blockheight", type: "blockheight",
date: "2009-01-03", date: "2009-01-03",
chain: "main",
blockHeight: 0, blockHeight: 0,
blockHash: "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f", blockHash: "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
summary: "The Bitcoin Genesis Block.", summary: "The Bitcoin Genesis Block.",
@ -118,6 +193,7 @@ module.exports = {
{ {
type: "tx", type: "tx",
date: "2009-01-03", date: "2009-01-03",
chain: "main",
txid: "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b", txid: "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
summary: "The coinbase transaction of the Genesis Block.", summary: "The coinbase transaction of the Genesis Block.",
alertBodyHtml: "This transaction doesn't really exist! This is the coinbase transaction of the <a href='/block/000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f'>Bitcoin Genesis Block</a>. For more background about this special-case transaction, you can read <a href='https://github.com/bitcoin/bitcoin/issues/3303'>this brief discussion</a> among some of the <a href='https://bitcoin.org'>Bitcoin</a> developers.", alertBodyHtml: "This transaction doesn't really exist! This is the coinbase transaction of the <a href='/block/000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f'>Bitcoin Genesis Block</a>. For more background about this special-case transaction, you can read <a href='https://github.com/bitcoin/bitcoin/issues/3303'>this brief discussion</a> among some of the <a href='https://bitcoin.org'>Bitcoin</a> developers.",
@ -126,6 +202,7 @@ module.exports = {
{ {
type: "tx", type: "tx",
date: "2009-10-12", date: "2009-10-12",
chain: "main",
txid: "7dff938918f07619abd38e4510890396b1cef4fbeca154fb7aafba8843295ea2", txid: "7dff938918f07619abd38e4510890396b1cef4fbeca154fb7aafba8843295ea2",
summary: "First bitcoin traded for fiat currency.", summary: "First bitcoin traded for fiat currency.",
alertBodyHtml: "In this first-known BTC-to-fiat transaction, 5,050 BTC were exchanged for 5.02 USD, at an effective exchange rate of ~0.001 USD/BTC.", alertBodyHtml: "In this first-known BTC-to-fiat transaction, 5,050 BTC were exchanged for 5.02 USD, at an effective exchange rate of ~0.001 USD/BTC.",
@ -134,6 +211,7 @@ module.exports = {
{ {
type: "blockheight", type: "blockheight",
date: "2017-08-24", date: "2017-08-24",
chain: "main",
blockHeight: 481824, blockHeight: 481824,
blockHash: "0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893", blockHash: "0000000000000000001c8018d9cb3b742ef25114f27563e3fc4a1902167f9893",
summary: "First SegWit block.", summary: "First SegWit block.",
@ -142,6 +220,7 @@ module.exports = {
{ {
type: "tx", type: "tx",
date: "2017-08-24", date: "2017-08-24",
chain: "main",
txid: "8f907925d2ebe48765103e6845C06f1f2bb77c6adc1cc002865865eb5cfd5c1c", txid: "8f907925d2ebe48765103e6845C06f1f2bb77c6adc1cc002865865eb5cfd5c1c",
summary: "First SegWit transaction.", summary: "First SegWit transaction.",
referenceUrl: "https://twitter.com/KHS9NE/status/900553902923362304" referenceUrl: "https://twitter.com/KHS9NE/status/900553902923362304"
@ -149,6 +228,7 @@ module.exports = {
{ {
type: "tx", type: "tx",
date: "2014-06-16", date: "2014-06-16",
chain: "main",
txid: "143a3d7e7599557f9d63e7f224f34d33e9251b2c23c38f95631b3a54de53f024", txid: "143a3d7e7599557f9d63e7f224f34d33e9251b2c23c38f95631b3a54de53f024",
summary: "Star Wars: A New Hope", summary: "Star Wars: A New Hope",
referenceUrl: "" referenceUrl: ""
@ -156,6 +236,7 @@ module.exports = {
{ {
type: "tx", type: "tx",
date: "2010-05-22", date: "2010-05-22",
chain: "main",
txid: "a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d", txid: "a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d",
summary: "The 'Bitcoin Pizza' transaction.", summary: "The 'Bitcoin Pizza' transaction.",
alertBodyHtml: "This is the famous 'Bitcoin Pizza' transaction.", alertBodyHtml: "This is the famous 'Bitcoin Pizza' transaction.",
@ -164,13 +245,16 @@ module.exports = {
{ {
type: "tx", type: "tx",
date: "2011-05-18", date: "2011-05-18",
chain: "main",
txid: "5d80a29be1609db91658b401f85921a86ab4755969729b65257651bb9fd2c10d", txid: "5d80a29be1609db91658b401f85921a86ab4755969729b65257651bb9fd2c10d",
summary: "Destroyed bitcoin.", summary: "Destroyed bitcoin.",
referenceUrl: "https://www.reddit.com/r/Bitcoin/comments/7mhoks/til_in_2011_a_user_running_a_modified_mining/" referenceUrl: "https://bitcointalk.org/index.php?topic=7253.msg184414#msg184414",
referenceUrl2: "https://www.reddit.com/r/Bitcoin/comments/7mhoks/til_in_2011_a_user_running_a_modified_mining/"
}, },
{ {
type: "blockheight", type: "blockheight",
date: "2009-01-12", date: "2009-01-12",
chain: "main",
blockHeight: 170, blockHeight: 170,
blockHash: "00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee", blockHash: "00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee",
summary: "First block containing a (non-coinbase) transaction.", summary: "First block containing a (non-coinbase) transaction.",
@ -180,6 +264,7 @@ module.exports = {
{ {
type: "blockheight", type: "blockheight",
date: "2017-08-25", date: "2017-08-25",
chain: "main",
blockHeight: 481947, blockHeight: 481947,
blockHash: "00000000000000000139cb443e16442fcd07a4a0e0788dd045ee3cf268982016", blockHash: "00000000000000000139cb443e16442fcd07a4a0e0788dd045ee3cf268982016",
summary: "First block mined that was greater than 1MB.", summary: "First block mined that was greater than 1MB.",
@ -188,6 +273,7 @@ module.exports = {
{ {
type: "blockheight", type: "blockheight",
date: "2018-01-20", date: "2018-01-20",
chain: "main",
blockHeight: 505225, blockHeight: 505225,
blockHash: "0000000000000000001bbb529c64ddf55edec8f4ebc0a0ccf1d3bb21c278bfa7", blockHash: "0000000000000000001bbb529c64ddf55edec8f4ebc0a0ccf1d3bb21c278bfa7",
summary: "First block mined that was greater than 2MB.", summary: "First block mined that was greater than 2MB.",
@ -196,6 +282,7 @@ module.exports = {
{ {
type: "tx", type: "tx",
date: "2017-12-30", date: "2017-12-30",
chain: "main",
txid: "9bf8853b3a823bbfa1e54017ae11a9e1f4d08a854dcce9f24e08114f2c921182", txid: "9bf8853b3a823bbfa1e54017ae11a9e1f4d08a854dcce9f24e08114f2c921182",
summary: "Block reward lost", summary: "Block reward lost",
alertBodyHtml: "This coinbase transaction completely fails to collect the block's mining reward. 12.5 BTC were lost.", alertBodyHtml: "This coinbase transaction completely fails to collect the block's mining reward. 12.5 BTC were lost.",
@ -204,6 +291,7 @@ module.exports = {
{ {
type:"address", type:"address",
date:"2011-12-03", date:"2011-12-03",
chain: "main",
address:"1JryTePceSiWVpoNBU8SbwiT7J4ghzijzW", address:"1JryTePceSiWVpoNBU8SbwiT7J4ghzijzW",
summary:"Brainwallet address for 'Satoshi Nakamoto'", summary:"Brainwallet address for 'Satoshi Nakamoto'",
referenceUrl:"https://twitter.com/MrHodl/status/1041448002005741568", referenceUrl:"https://twitter.com/MrHodl/status/1041448002005741568",
@ -212,6 +300,7 @@ module.exports = {
{ {
type: "tx", type: "tx",
date: "2010-11-14", date: "2010-11-14",
chain: "main",
txid: "e3bf3d07d4b0375638d5f1db5255fe07ba2c4cb067cd81b84ee974b6585fb468", txid: "e3bf3d07d4b0375638d5f1db5255fe07ba2c4cb067cd81b84ee974b6585fb468",
summary: "Duplicated coinbase transaction #1", summary: "Duplicated coinbase transaction #1",
referenceUrl: "https://bitcoin.stackexchange.com/questions/38994/will-there-be-21-million-bitcoins-eventually/38998#38998", referenceUrl: "https://bitcoin.stackexchange.com/questions/38994/will-there-be-21-million-bitcoins-eventually/38998#38998",
@ -220,11 +309,56 @@ module.exports = {
{ {
type: "tx", type: "tx",
date: "2010-11-14", date: "2010-11-14",
chain: "main",
txid: "d5d27987d2a3dfc724e359870c6644b40e497bdc0589a033220fe15429d88599", txid: "d5d27987d2a3dfc724e359870c6644b40e497bdc0589a033220fe15429d88599",
summary: "Duplicated coinbase transaction #2", summary: "Duplicated coinbase transaction #2",
referenceUrl: "https://bitcoin.stackexchange.com/questions/38994/will-there-be-21-million-bitcoins-eventually/38998#38998", referenceUrl: "https://bitcoin.stackexchange.com/questions/38994/will-there-be-21-million-bitcoins-eventually/38998#38998",
alertBodyHtml: "This is one of 2 'duplicate coinbase' transactions. An early bitcoin bug (fixed by <a href='https://github.com/bitcoin/bips/blob/master/bip-0030.mediawiki'>BIP30</a>) allowed identical coinbase transactions - a newer duplicate would overwrite older copies. This transaction was the coinbase transaction for <a href='/block-height/91812'>Block #91,812</a> and, ~3 hours later, <a href='/block-height/91842'>Block #91,842</a>. The 50 BTC claimed as the coinbase for block 91,812 were also overwritten and lost." alertBodyHtml: "This is one of 2 'duplicate coinbase' transactions. An early bitcoin bug (fixed by <a href='https://github.com/bitcoin/bips/blob/master/bip-0030.mediawiki'>BIP30</a>) allowed identical coinbase transactions - a newer duplicate would overwrite older copies. This transaction was the coinbase transaction for <a href='/block-height/91812'>Block #91,812</a> and, ~3 hours later, <a href='/block-height/91842'>Block #91,842</a>. The 50 BTC claimed as the coinbase for block 91,812 were also overwritten and lost."
} },
// testnet
{
type: "blockheight",
date: "2011-02-02",
chain: "test",
blockHeight: 0,
blockHash: "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943",
summary: "The Bitcoin (regtest) Genesis Block.",
alertBodyHtml: "This is the first block in the Bitcoin blockchain, known as the 'Genesis Block'. You can read more about <a href='https://en.bitcoin.it/wiki/Genesis_block'>the genesis block</a>.",
referenceUrl: "https://en.bitcoin.it/wiki/Genesis_block"
},
{
type: "tx",
date: "2011-02-02",
chain: "test",
txid: "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
summary: "The coinbase transaction of the Genesis Block.",
alertBodyHtml: "This transaction doesn't really exist! This is the coinbase transaction of the <a href='/block/000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f'>Bitcoin Genesis Block</a>. For more background about this special-case transaction, you can read <a href='https://github.com/bitcoin/bitcoin/issues/3303'>this brief discussion</a> among some of the <a href='https://bitcoin.org'>Bitcoin</a> developers.",
referenceUrl: "https://github.com/bitcoin/bitcoin/issues/3303"
},
// regtest
{
type: "blockheight",
date: "2011-02-02",
chain: "regtest",
blockHeight: 0,
blockHash: "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206",
summary: "The Bitcoin (regtest) Genesis Block.",
alertBodyHtml: "This is the first block in the Bitcoin blockchain, known as the 'Genesis Block'. You can read more about <a href='https://en.bitcoin.it/wiki/Genesis_block'>the genesis block</a>.",
referenceUrl: "https://en.bitcoin.it/wiki/Genesis_block"
},
{
type: "tx",
date: "2011-02-02",
chain: "regtest",
txid: "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
summary: "The coinbase transaction of the Genesis Block.",
alertBodyHtml: "This transaction doesn't really exist! This is the coinbase transaction of the <a href='/block/000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f'>Bitcoin Genesis Block</a>. For more background about this special-case transaction, you can read <a href='https://github.com/bitcoin/bitcoin/issues/3303'>this brief discussion</a> among some of the <a href='https://bitcoin.org'>Bitcoin</a> developers.",
referenceUrl: "https://github.com/bitcoin/bitcoin/issues/3303"
},
], ],
exchangeRateData:{ exchangeRateData:{
jsonUrl:"https://api.coindesk.com/v1/bpi/currentprice.json", jsonUrl:"https://api.coindesk.com/v1/bpi/currentprice.json",
@ -248,14 +382,15 @@ module.exports = {
return null; return null;
} }
}, },
blockRewardFunction:function(blockHeight) { blockRewardFunction:function(blockHeight, chain) {
var eras = [ new Decimal8(50) ]; var eras = [ new Decimal8(50) ];
for (var i = 1; i < 34; i++) { for (var i = 1; i < 34; i++) {
var previous = eras[i - 1]; var previous = eras[i - 1];
eras.push(new Decimal8(previous).dividedBy(2)); eras.push(new Decimal8(previous).dividedBy(2));
} }
var index = Math.floor(blockHeight / 210000); var halvingBlockInterval = (chain == "regtest" ? 150 : 210000);
var index = Math.floor(blockHeight / halvingBlockInterval);
return eras[index]; return eras[index];
} }

4
app/utils.js

@ -284,7 +284,7 @@ function getTxTotalInputOutputValues(tx, txInputs, blockHeight) {
try { try {
for (var i = 0; i < tx.vin.length; i++) { for (var i = 0; i < tx.vin.length; i++) {
if (tx.vin[i].coinbase) { if (tx.vin[i].coinbase) {
totalInputValue = totalInputValue.plus(new Decimal(coinConfig.blockRewardFunction(blockHeight))); totalInputValue = totalInputValue.plus(new Decimal(coinConfig.blockRewardFunction(blockHeight, global.activeBlockchain)));
} else { } else {
var txInput = txInputs[i]; var txInput = txInputs[i];
@ -317,7 +317,7 @@ function getBlockTotalFeesFromCoinbaseTxAndBlockHeight(coinbaseTx, blockHeight)
return 0; return 0;
} }
var blockReward = coinConfig.blockRewardFunction(blockHeight); var blockReward = coinConfig.blockRewardFunction(blockHeight, global.activeBlockchain);
var totalOutput = new Decimal(0); var totalOutput = new Decimal(0);
for (var i = 0; i < coinbaseTx.vout.length; i++) { for (var i = 0; i < coinbaseTx.vout.length; i++) {

643
npm-shrinkwrap.json

File diff suppressed because it is too large

31
package.json

@ -1,6 +1,6 @@
{ {
"name": "btc-rpc-explorer", "name": "btc-rpc-explorer",
"version": "1.1.2", "version": "1.1.4",
"description": "Explorer for Bitcoin and RPC-compatible blockchains", "description": "Explorer for Bitcoin and RPC-compatible blockchains",
"private": false, "private": false,
"bin": "bin/cli.js", "bin": "bin/cli.js",
@ -20,33 +20,34 @@
"url": "git+https://github.com/janoside/btc-rpc-explorer.git" "url": "git+https://github.com/janoside/btc-rpc-explorer.git"
}, },
"dependencies": { "dependencies": {
"async": "2.6.2", "async": "^3.1.0",
"basic-auth": "^2.0.1", "basic-auth": "^2.0.1",
"bitcoin-core": "2.0.0", "bitcoin-core": "^2.3.0",
"bitcoinjs-lib": "5.0.3", "bitcoinjs-lib": "^5.1.6",
"bluebird": "^3.7.2",
"body-parser": "~1.19.0", "body-parser": "~1.19.0",
"cookie-parser": "^1.4.4", "cookie-parser": "^1.4.4",
"crypto-js": "3.1.9-1", "crypto-js": "3.1.9-1",
"csurf": "^1.10.0", "csurf": "^1.10.0",
"debug": "~4.1.1", "debug": "~4.1.1",
"decimal.js": "10.1.1", "decimal.js": "^10.2.0",
"dotenv": "^8.1.0", "dotenv": "^8.2.0",
"electrum-client": "github:chaintools/node-electrum-client#43a999036f9c5", "electrum-client": "github:chaintools/node-electrum-client#43a999036f9c5",
"express": "^4.17.1", "express": "^4.17.1",
"express-session": "1.16.1", "express-session": "^1.17.0",
"jstransformer-markdown-it": "^2.1.0", "jstransformer-markdown-it": "^2.1.0",
"lru-cache": "5.1.1", "lru-cache": "^5.1.1",
"marked": "0.7.0", "marked": "^0.7.0",
"meow": "^5.0.0", "meow": "^5.0.0",
"moment": "^2.24.0", "moment": "^2.24.0",
"moment-duration-format": "2.2.2", "moment-duration-format": "^2.3.2",
"morgan": "^1.9.1", "morgan": "^1.9.1",
"pug": "2.0.3", "pug": "^2.0.4",
"qrcode": "1.3.3", "qrcode": "^1.4.4",
"redis": "2.8.0", "redis": "^2.8.0",
"request": "2.88.0", "request": "^2.88.0",
"serve-favicon": "^2.5.0", "serve-favicon": "^2.5.0",
"simple-git": "1.112.0" "simple-git": "^1.126.0"
}, },
"devDependencies": { "devDependencies": {
"less": "3.9.0", "less": "3.9.0",

70
public/txt/mining-pools-configs/BTC/0.json

@ -2,7 +2,11 @@
"coinbase_tags" : { "coinbase_tags" : {
"/LUXOR/": { "/LUXOR/": {
"name": "Luxor", "name": "Luxor",
"link": "https://mining.luxor.tech/" "link": "https://mining.luxor.tech"
},
"/1THash&58COIN/": {
"name": "1THash&58COIN",
"link": "https://www.1thash.top"
}, },
"BITFARMS": { "BITFARMS": {
"name": "Bitfarms", "name": "Bitfarms",
@ -12,6 +16,10 @@
"name": "Huobi.pool", "name": "Huobi.pool",
"link": "https://www.poolhb.com/" "link": "https://www.poolhb.com/"
}, },
"/HuoBi/": {
"name": "Huobi.pool",
"link": "https://www.poolhb.com/"
},
"/E2M & BTC.TOP/": { "/E2M & BTC.TOP/": {
"name": "WAYI.CN", "name": "WAYI.CN",
"link": "http://www.easy2mine.com/" "link": "http://www.easy2mine.com/"
@ -300,6 +308,14 @@
"name": "Bixin", "name": "Bixin",
"link": "https://haopool.com/" "link": "https://haopool.com/"
}, },
"HAOBTC" : {
"name": "Bixin",
"link": "https://haopool.com/"
},
"/Bixin/" : {
"name": "Bixin",
"link": "https://haopool.com/"
},
"viabtc.com deploy" : { "viabtc.com deploy" : {
"name": "ViaBTC", "name": "ViaBTC",
"link": "https://viabtc.com" "link": "https://viabtc.com"
@ -324,10 +340,6 @@
"name" : "Waterhole", "name" : "Waterhole",
"link" : "https://btc.waterhole.io/" "link" : "https://btc.waterhole.io/"
}, },
"/BTC.COM/" : {
"name" : "BTC.com",
"link" : "https://pool.btc.com"
},
"/DCExploration/" : { "/DCExploration/" : {
"name" : "DCExploration", "name" : "DCExploration",
"link" : "http://dcexploration.cn" "link" : "http://dcexploration.cn"
@ -419,9 +431,33 @@
"/www.okpool.top/": { "/www.okpool.top/": {
"name" : "okpool.top", "name" : "okpool.top",
"link" : "https://www.okpool.top" "link" : "https://www.okpool.top"
},
"HummerPool": {
"name" : "Hummerpool",
"link" : "https://www.hummerpool.com"
},
"Hummerpool": {
"name" : "Hummerpool",
"link" : "https://www.hummerpool.com"
},
"/Tangpool/": {
"name" : "Tangpool",
"link" : "http://www.tangpool.com/"
},
"/bytepool.com/": {
"name" : "BytePool",
"link" : "https://bytepool.com/"
},
"/SpiderPool.com/": {
"name" : "SpiderPool",
"link" : "https://www.spiderpool.com/"
} }
}, },
"payout_addresses" : { "payout_addresses" : {
"3Bmb9Jig8A5kHdDSxvDZ6eryj3AXd3swuJ": {
"name" : "NovaBlock",
"link" : "https://novablock.com"
},
"3GvEGtnvgeBJ3p3EpdZhvUkxY4pDARkbjd" : { "3GvEGtnvgeBJ3p3EpdZhvUkxY4pDARkbjd" : {
"name" : "Bitfarms", "name" : "Bitfarms",
"link" : "https://www.bitfarms.io/" "link" : "https://www.bitfarms.io/"
@ -662,6 +698,10 @@
"name" : "BTC.com", "name" : "BTC.com",
"link" : "https://pool.btc.com" "link" : "https://pool.btc.com"
}, },
"bc1qjl8uwezzlech723lpnyuza0h2cdkvxvh54v3dn" : {
"name" : "BTC.com",
"link" : "https://pool.btc.com"
},
"18EPLvrs2UE11kWBB3ABS7Crwj5tTBYPoa" : { "18EPLvrs2UE11kWBB3ABS7Crwj5tTBYPoa" : {
"name" : "GoGreenLight", "name" : "GoGreenLight",
"link" : "http://www.gogreenlight.se/" "link" : "http://www.gogreenlight.se/"
@ -793,6 +833,26 @@
"3JQSigWTCHyBLRD979JWgEtWP5YiiFwcQB" : { "3JQSigWTCHyBLRD979JWgEtWP5YiiFwcQB" : {
"name" : "Poolin", "name" : "Poolin",
"link" : "https://www.poolin.com/" "link" : "https://www.poolin.com/"
},
"12Taz8FFXQ3E2AGn3ZW1SZM5bLnYGX4xR6" : {
"name" : "Tangpool",
"link" : "http://www.tangpool.com/"
},
"1MvYASoHjqynMaMnP7SBmenyEWiLsTqoU6" : {
"name": "Huobi.pool",
"link": "https://www.poolhb.com/"
},
"1M1Xw2rczxkF3p3wiNHaTmxvbpZZ7M6vaa" : {
"name": "1M1X",
"link": ""
},
"39m5Wvn9ZqyhYmCYpsyHuGMt5YYw4Vmh1Z" : {
"name": "BytePool",
"link": "https://bytepool.com/"
},
"38u1srayb1oybVB43UWKBJsrwJbdHGtPx2": {
"name" : "SpiderPool",
"link" : "https://www.spiderpool.com/"
} }
} }
} }

64
public/txt/mining-pools-configs/BTC/1.json

@ -1,5 +1,17 @@
{ {
"coinbase_tags" : { "coinbase_tags" : {
"/LUXOR/": {
"name": "Luxor",
"link": "https://mining.luxor.tech"
},
"Rawpool.com" : {
"name" : "Rawpool.com",
"link" : "https://www.rawpool.com/"
},
"/poolin.com/" : {
"name" : "Poolin",
"link" : "https://www.poolin.com"
},
"SigmaPool.com" : { "SigmaPool.com" : {
"name" : "SigmaPool.com", "name" : "SigmaPool.com",
"link" : "https://www.sigmapool.com/" "link" : "https://www.sigmapool.com/"
@ -276,6 +288,10 @@
"name": "Bixin", "name": "Bixin",
"link": "https://haopool.com/" "link": "https://haopool.com/"
}, },
"/Bixin/" : {
"name": "Bixin",
"link": "https://haopool.com/"
},
"viabtc.com deploy" : { "viabtc.com deploy" : {
"name": "ViaBTC", "name": "ViaBTC",
"link": "https://viabtc.com" "link": "https://viabtc.com"
@ -355,6 +371,10 @@
"/haominer/" : { "/haominer/" : {
"name": "Haominer", "name": "Haominer",
"link": "http://haominer.com/" "link": "http://haominer.com/"
},
"Hummerpool" : {
"name" : "Hummerpool",
"link" : ""
} }
}, },
"payout_addresses" : { "payout_addresses" : {
@ -694,6 +714,50 @@
"name": "Poolin", "name": "Poolin",
"link": "https://www.poolin.com/" "link": "https://www.poolin.com/"
}, },
"3DXfeMBimuvN3TWnQXDhr47P8M8yxMy9Pd" : {
"name": "Poolin",
"link": "https://www.poolin.com/"
},
"36aC6xMXYaRdL1nobKfqYVCjKhZVXWN8RX" : {
"name": "Poolin",
"link": "https://www.poolin.com/"
},
"15kNvZYY9HWg4wE7Fd73o96P5eKb96Yyfa" : {
"name": "Poolin",
"link": "https://www.poolin.com/"
},
"3KWcQ4Xe5Dc3R1UMWatf1knJY6Zu61MZKV" : {
"name": "Poolin",
"link": "https://www.poolin.com/"
},
"35qGBQsRQb8CSUzcSWktMykeA6zm5iCEJJ" : {
"name": "Poolin",
"link": "https://www.poolin.com/"
},
"3JAvzKWgtxPzcbTqKeAT7qfwoZBjtVmkBU" : {
"name": "Poolin",
"link": "https://www.poolin.com/"
},
"347a2vGV9r4RyrKoBiVnCLnBN4rDYDWUyy" : {
"name": "Poolin",
"link": "https://www.poolin.com/"
},
"3EFdpy14AqDsbQy3XGYyoGDrLYrbB8XWSs" : {
"name": "Poolin",
"link": "https://www.poolin.com/"
},
"1382v6T81xCPFeLaQq6UTuq7HFySq27LcX" : {
"name": "Poolin",
"link": "https://www.poolin.com/"
},
"1D1ULAXyEX2zrLSMX9xMFVQKzEGqPfkJVS" : {
"name": "Poolin",
"link": "https://www.poolin.com/"
},
"1M1Xw2rczxkF3p3wiNHaTmxvbpZZ7M6vaa" : {
"name": "Poolin",
"link": "https://www.poolin.com/"
},
"3KJrsjfg1dD6CrsTeHdHVH3KqMpvL2XWQn" : { "3KJrsjfg1dD6CrsTeHdHVH3KqMpvL2XWQn" : {
"name": "Poolin", "name": "Poolin",
"link": "https://www.poolin.com/" "link": "https://www.poolin.com/"

134
public/txt/mining-pools-configs/LTC/0.json

@ -1,9 +1,17 @@
{ {
"coinbase_tags": { "coinbase_tags": {
"BITFARMS": {
"name": "Bitfarms",
"link": "https://www.bitarms.io/"
},
"/Huobi/": { "/Huobi/": {
"name": "Huobi.pool", "name": "Huobi.pool",
"link": "https://www.poolhb.com/" "link": "https://www.poolhb.com/"
}, },
"/HuoBi/": {
"name": "Huobi.pool",
"link": "https://www.poolhb.com/"
},
"/E2M & BTC.TOP/": { "/E2M & BTC.TOP/": {
"name": "WAYI.CN", "name": "WAYI.CN",
"link": "http://www.easy2mine.com/" "link": "http://www.easy2mine.com/"
@ -432,10 +440,6 @@
"name": "Rawpool.com", "name": "Rawpool.com",
"link": "https://www.rawpool.com/" "link": "https://www.rawpool.com/"
}, },
"tiger": {
"name": "tiger",
"link": ""
},
"/haominer/": { "/haominer/": {
"name": "haominer", "name": "haominer",
"link": "http://haominer.com/" "link": "http://haominer.com/"
@ -466,10 +470,38 @@
}, },
"/SecretSuperstar/": { "/SecretSuperstar/": {
"name": "SecretSuperstar", "name": "SecretSuperstar",
"link": "http://google.com/search?q=SecretSuperstar" "link": "https://google.com/search?q=SecretSuperstar"
},
"/poolin.com": {
"name": "Poolin",
"link": "https://www.poolin.com/"
},
"/tigerpool.net": {
"name": "tigerpool.net",
"link": ""
},
"/SigmaPool.com/": {
"name": "sigmapool.com",
"link": "https://sigmapool.com"
},
"/www.okpool.top/": {
"name": "okpool.top",
"link": "https://www.okpool.top"
},
"Hummerpool": {
"name": "Hummerpool",
"link": ""
},
"/Tangpool/": {
"name": "Tangpool",
"link": "http://www.tangpool.com/"
} }
}, },
"payout_addresses": { "payout_addresses": {
"3GvEGtnvgeBJ3p3EpdZhvUkxY4pDARkbjd": {
"name": "Bitfarms",
"link": "https://www.bitfarms.io/"
},
"1CjPR7Z5ZSyWk6WtXvSFgkptmpoi4UM9BC": { "1CjPR7Z5ZSyWk6WtXvSFgkptmpoi4UM9BC": {
"name": "GHash.IO", "name": "GHash.IO",
"link": "https://ghash.io/" "link": "https://ghash.io/"
@ -834,6 +866,14 @@
"name": "Poolin", "name": "Poolin",
"link": "https://www.poolin.com/" "link": "https://www.poolin.com/"
}, },
"3JQSigWTCHyBLRD979JWgEtWP5YiiFwcQB": {
"name": "Poolin",
"link": "https://www.poolin.com/"
},
"12Taz8FFXQ3E2AGn3ZW1SZM5bLnYGX4xR6": {
"name": "Tangpool",
"link": "http://www.tangpool.com/"
},
"EZBxbLXkHwCRHgbSVGXkTkgNY2RSWaYpAP": { "EZBxbLXkHwCRHgbSVGXkTkgNY2RSWaYpAP": {
"name": "CryptoADHD.com", "name": "CryptoADHD.com",
"link": "https://irl.cryptoadhd.com" "link": "https://irl.cryptoadhd.com"
@ -841,90 +881,6 @@
"EU43PoAHphjbHzcfoVziWd4aLHdZNQ1XKM": { "EU43PoAHphjbHzcfoVziWd4aLHdZNQ1XKM": {
"name": "ProHashing", "name": "ProHashing",
"link": "https://prohashing.com/" "link": "https://prohashing.com/"
},
"Lhh4idZ9eFgZt9wPGxMVdJmGJoGy2o2sCj": {
"name": "hashing.com",
"link": "https://hashing.com"
},
"Ld7Po2mbs1mWtz5aVEVgmEzDp8Zw3ndwhm": {
"name": "MultiPool",
"link": "https://www.multipool.us"
},
"LTftBH8seFk7iEJkib7d8bDaaLMFDeq4Sf": {
"name": "suprnova.cc",
"link": "https://www.suprnova.cc/"
},
"LSAXhjJBeyQ5nqvgrwF96Wnt2VrDGwV2Wf": {
"name": "mining-dutch.nl",
"link": "https://www.mining-dutch.nl"
},
"LhkFjuGkVcdriLU2HWnph1tSLd9Fk7deCn": {
"name": "ProHashing",
"link": "https://prohashing.com/"
},
"Lcvd2ka6ecXaxjGbuyWDKURpUf9pXXPVKK": {
"name": "Coinotron",
"link": "https://www.coinotron.com"
},
"LeD2fnnDJYZuyt8zgDsZ2oBGmuVcxGKCLd": {
"name": "P2P-multipool.eu",
"link": "http://p2p-multipool.eu/"
},
"XjRizKLj64toLfPk2vEDxk8d2pBtkVd6oa": {
"name": "CryptoADHD.com",
"link": "https://dash.cryptoadhd.com"
},
"XqPQ26xGigKkq4yCNmTfgkRPdt8FyB547J": {
"name": "P2P-multipool.eu",
"link": "http://p2p-multipool.eu/"
},
"XiEFG1tTyXuYbcFvcYYRC8cJgmRJAJi2ue": {
"name": "Coinotron",
"link": "https://www.coinotron.com"
},
"bitcoincash:qrgrmfhu5wgpvmgzp0sw0s52erx8pavyqvkhmltum6": {
"name": "P2P-multipool.eu",
"link": "http://p2p-multipool.eu/"
},
"bitcoincash:qrr7jtg5nxkq0ry75vyklk5kzt0hv4a2lqs83a25ky": {
"name": "BitClub",
"link": "https://bitclubpool.com/"
},
"GK18bp4UzC6wqYKKNLkaJ3hzQazTc3TWBw": {
"name": "MiningPoolHub",
"link": "https://miningpoolhub.com/"
},
"GJjz2Du9BoJQ3CPcoyVTHUJZSj62i1693U": {
"name": "2miners.com",
"link": "https://2miners.com"
},
"GWViUY2b3HAYWY9BbeGeFjc6rKdrBffzHa": {
"name": "Pool.Gold",
"link": "http://new.pool.gold"
},
"GSArGviLRTDBYSY69f7v9o6Dc7jhNY2Txo": {
"name": "MinerGate",
"link": "https://minergate.com"
},
"GVQiajM9TTSNVATL3JEGLG9s48TWHTJg8S": {
"name": "suprnova.cc",
"link": "https://www.suprnova.cc/"
},
"GPqm77aX5eR1ydAgiCLPqGMYDjVppc391J": {
"name": "Mining4",
"link": "http://btg.mining4.co.uk/"
},
"GKgCEhrm9MHVXMXbygFgzeiQQCUGQtgfpQ": {
"name": "Gpool.guru",
"link": "https://gpool.guru"
},
"GJVJXJgFvSjyUwaZHy2VSbemvLNzAyXQEs": {
"name": "PandaPool",
"link": "https://pandapool.io"
},
"GfdptpRd1m1jtgi32qEf1UU1myysTxQjsg": {
"name": "coinfoundry",
"link": "https://coinfoundry.org/"
} }
} }
} }

4
routes/baseActionsRouter.js

@ -74,6 +74,10 @@ router.get("/", function(req, res, next) {
for (var i = 0; i < 10; i++) { for (var i = 0; i < 10; i++) {
blockHeights.push(getblockchaininfo.blocks - i); blockHeights.push(getblockchaininfo.blocks - i);
} }
} else if (global.activeBlockchain == "regtest") {
// hack: default regtest node returns getblockchaininfo.blocks=0, despite having a genesis block
// hack this to display the genesis block
blockHeights.push(0);
} }
if (getblockchaininfo.chain !== 'regtest') { if (getblockchaininfo.chain !== 'regtest') {

1
views/fun.pug

@ -19,6 +19,7 @@ block content
th(class="data-header") Reference th(class="data-header") Reference
tbody tbody
each item, index in coinConfig.historicalData each item, index in coinConfig.historicalData
if (item.chain == global.activeBlockchain)
tr tr
td(class="data-cell") #{item.date} td(class="data-cell") #{item.date}

2
views/includes/block-content.pug

@ -73,7 +73,7 @@ div(class="tab-content")
- var currencyValue = new Decimal(result.getblock.totalFees).dividedBy(result.getblock.tx.length); - var currencyValue = new Decimal(result.getblock.totalFees).dividedBy(result.getblock.tx.length);
include ./value-display.pug include ./value-display.pug
- var blockRewardMax = coinConfig.blockRewardFunction(result.getblock.height); - var blockRewardMax = coinConfig.blockRewardFunction(result.getblock.height, global.activeBlockchain);
- var coinbaseTxTotalOutputValue = new Decimal(0); - var coinbaseTxTotalOutputValue = new Decimal(0);
each vout in result.getblock.coinbaseTx.vout each vout in result.getblock.coinbaseTx.vout
- coinbaseTxTotalOutputValue = coinbaseTxTotalOutputValue.plus(new Decimal(vout.value)); - coinbaseTxTotalOutputValue = coinbaseTxTotalOutputValue.plus(new Decimal(vout.value));

2
views/includes/transaction-io-details.pug

@ -61,7 +61,7 @@ div(class="row monospace")
div(class="tx-io-value") div(class="tx-io-value")
if (txVin.coinbase) if (txVin.coinbase)
- var currencyValue = coinConfig.blockRewardFunction(blockHeight); - var currencyValue = coinConfig.blockRewardFunction(blockHeight, global.activeBlockchain);
include ./value-display.pug include ./value-display.pug
else else
if (vout && vout.value) if (vout && vout.value)

6
views/layout.pug

@ -44,6 +44,12 @@ html(lang="en")
a(href="/about", class="nav-link") a(href="/about", class="nav-link")
span About span About
if (global.activeBlockchain != "main")
- var chainName = global.activeBlockchain == "test" ? "testnet" : global.activeBlockchain
li.nav-item
a.nav-link.text-warning(title=`Current node's chain: ${global.activeBlockchain}` data-toggle="tooltip") [#{chainName}]
if (config.siteTools) if (config.siteTools)
li(class="nav-item dropdown") li(class="nav-item dropdown")
a(class="nav-link dropdown-toggle", href="javascript:void(0)", role="button", data-toggle="dropdown", aria-haspopup="true", aria-expanded="false") a(class="nav-link dropdown-toggle", href="javascript:void(0)", role="button", data-toggle="dropdown", aria-haspopup="true", aria-expanded="false")

6
views/peers.pug

@ -34,7 +34,7 @@ block content
div(id="tab-summary", class="tab-pane active", role="tabpanel") div(id="tab-summary", class="tab-pane active", role="tabpanel")
if (peerIpSummary.ips) if (peerIpSummary && peerIpSummary.ips)
div(id="map", class="mb-4") div(id="map", class="mb-4")
div(class="card mb-4 shadow-sm") div(class="card mb-4 shadow-sm")
@ -93,7 +93,7 @@ block content
th(class="data-header") Address th(class="data-header") Address
th(class="data-header") Services th(class="data-header") Services
if (peerIpSummary.ips) if (peerIpSummary && peerIpSummary.ips)
th(class="data-header") Location th(class="data-header") Location
th(class="data-header") Last Send / Receive th(class="data-header") Last Send / Receive
@ -161,7 +161,7 @@ block endOfBody
$(".data-table").DataTable(); $(".data-table").DataTable();
}); });
if (peerIpSummary.ips) if (peerIpSummary && peerIpSummary.ips)
script. script.
var mymap = L.map('map').setView([21.505, -0.09], 3); var mymap = L.map('map').setView([21.505, -0.09], 3);

4
views/transaction.pug

@ -27,7 +27,7 @@ block content
- var totalInputValue = new Decimal(0); - var totalInputValue = new Decimal(0);
if (result.getrawtransaction.vin[0].coinbase) if (result.getrawtransaction.vin[0].coinbase)
- totalInputValue = totalInputValue.plus(new Decimal(coinConfig.blockRewardFunction(result.getblock.height))); - totalInputValue = totalInputValue.plus(new Decimal(coinConfig.blockRewardFunction(result.getblock.height, global.activeBlockchain)));
each txInput, txInputIndex in result.txInputs each txInput, txInputIndex in result.txInputs
if (txInput) if (txInput)
- var vout = txInput.vout[result.getrawtransaction.vin[txInputIndex].vout]; - var vout = txInput.vout[result.getrawtransaction.vin[txInputIndex].vout];
@ -168,7 +168,7 @@ block content
- var currencyValue = new Decimal(totalOutputValue).minus(totalInputValue); - var currencyValue = new Decimal(totalOutputValue).minus(totalInputValue);
include includes/value-display.pug include includes/value-display.pug
- var blockRewardMax = coinConfig.blockRewardFunction(result.getblock.height); - var blockRewardMax = coinConfig.blockRewardFunction(result.getblock.height, global.activeBlockchain);
if (parseFloat(totalOutputValue) < parseFloat(blockRewardMax)) if (parseFloat(totalOutputValue) < parseFloat(blockRewardMax))
div(class="row") div(class="row")
div(class="summary-table-label") div(class="summary-table-label")

Loading…
Cancel
Save