Browse Source
Separate max supply value per network...
Because the value configured for mainnet takes into account many known coin destructions which don't apply to testnet/regtest
master
Dan Janosik
5 years ago
No known key found for this signature in database
GPG Key ID: C6F8CE9FFDB2CED2
3 changed files with
10 additions and
2 deletions
-
app.js
-
app/coins/btc.js
-
views/includes/index-network-summary.pug
|
|
@ -486,8 +486,10 @@ app.use(function(req, res, next) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// make a bunch of globals available to templates
|
|
|
|
res.locals.config = global.config; |
|
|
|
res.locals.coinConfig = global.coinConfig; |
|
|
|
res.locals.activeBlockchain = global.activeBlockchain; |
|
|
|
res.locals.exchangeRates = global.exchangeRates; |
|
|
|
res.locals.utxoSetSummary = global.utxoSetSummary; |
|
|
|
res.locals.utxoSetSummaryPending = global.utxoSetSummaryPending; |
|
|
|
|
|
@ -73,7 +73,11 @@ module.exports = { |
|
|
|
maxBlockWeight: 4000000, |
|
|
|
maxBlockSize: 1000000, |
|
|
|
difficultyAdjustmentBlockCount: 2016, |
|
|
|
maxSupply: new Decimal(20999817.31308491), // ref: https://bitcoin.stackexchange.com/a/38998
|
|
|
|
maxSupplyByNetwork: { |
|
|
|
"main": new Decimal(20999817.31308491), // ref: https://bitcoin.stackexchange.com/a/38998
|
|
|
|
"test": new Decimal(21000000), |
|
|
|
"regtest": new Decimal(21000000) |
|
|
|
}, |
|
|
|
targetBlockTimeSeconds: 600, |
|
|
|
targetBlockTimeMinutes: 10, |
|
|
|
currencyUnits:currencyUnits, |
|
|
|
|
|
@ -176,7 +176,9 @@ div.row.index-summary |
|
|
|
span Total Supply |
|
|
|
td.text-right.text-monospace |
|
|
|
if (utxoSetSummary) |
|
|
|
span.border-dotted(title=`${new Decimal(utxoSetSummary.total_amount).dividedBy(coinConfig.maxSupply).times(100).toDP(4)}% produced`, data-toggle="tooltip") #{parseFloat(utxoSetSummary.total_amount).toLocaleString()} |
|
|
|
- var maxSupply = coinConfig.maxSupplyByNetwork[activeBlockchain]; |
|
|
|
|
|
|
|
span.border-dotted(title=`${new Decimal(utxoSetSummary.total_amount).dividedBy(maxSupply).times(100).toDP(4)}% produced`, data-toggle="tooltip") #{parseFloat(utxoSetSummary.total_amount).toLocaleString()} |
|
|
|
else |
|
|
|
small.text-muted.border-dotted(title=utxoCalculatingDesc, data-toggle="tooltip") calculating... |
|
|
|
|
|
|
|