Browse Source

More work on mempool summary; cleanup and fixes for LTC

fix-133-memory-crash
Dan Janosik 7 years ago
parent
commit
d360a80972
  1. 3
      app/coins/btc.js
  2. 17
      app/coins/ltc.js
  3. 2
      app/rpcApi.js
  4. 12
      views/mempool-summary.pug

3
app/coins/btc.js

@ -32,10 +32,11 @@ module.exports = {
{ {
name:"sat", name:"sat",
multiplier:100000000, multiplier:100000000,
values:["sat"], values:["sat", "satoshi"],
decimalPlaces:0 decimalPlaces:0
} }
], ],
feeSatoshiPerByteBucketMaxima: [1, 5, 10, 15, 20, 25, 50, 75, 100, 150],
genesisBlockHash: "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f", genesisBlockHash: "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
genesisCoinbaseTransactionId: "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b", genesisCoinbaseTransactionId: "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
genesisCoinbaseTransaction: { genesisCoinbaseTransaction: {

17
app/coins/ltc.js

@ -17,12 +17,25 @@ module.exports = {
decimalPlaces:8 decimalPlaces:8
}, },
{ {
name:"mLTC", name:"lite",
multiplier:1000, multiplier:1000,
values:["mltc"], values:["lite"],
decimalPlaces:5 decimalPlaces:5
},
{
name:"photon",
multiplier:1000000,
values:["photon"],
decimalPlaces:2
},
{
name:"litoshi",
multiplier:100000000,
values:["litoshi", "lit"],
decimalPlaces:0
} }
], ],
feeSatoshiPerByteBucketMaxima: [5, 10, 25, 50, 100, 150, 200, 250],
genesisBlockHash: "12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2", genesisBlockHash: "12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2",
genesisCoinbaseTransactionId: "97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9", genesisCoinbaseTransactionId: "97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9",
genesisCoinbaseTransaction: { genesisCoinbaseTransaction: {

2
app/rpcApi.js

@ -120,7 +120,7 @@ function getMempoolStats() {
} }
} }
var satoshiPerByteBucketMaxima = [1, 5, 10, 15, 20, 25, 50, 75, 100, 150]; var satoshiPerByteBucketMaxima = coins[env.coin].feeSatoshiPerByteBucketMaxima;
var bucketCount = satoshiPerByteBucketMaxima.length + 1; var bucketCount = satoshiPerByteBucketMaxima.length + 1;
var satoshiPerByteBuckets = []; var satoshiPerByteBuckets = [];

12
views/mempool-summary.pug

@ -29,6 +29,7 @@ block content
span(data-toggle="tooltip", title=utils.formatExchangedCurrency(mempoolstats["totalFees"])) span(data-toggle="tooltip", title=utils.formatExchangedCurrency(mempoolstats["totalFees"]))
i(class="fas fa-exchange-alt") i(class="fas fa-exchange-alt")
if (getmempoolinfo.size > 0)
tr tr
th(class="table-active properties-header") Average Fee th(class="table-active properties-header") Average Fee
td(class="monospace") #{utils.formatCurrencyAmount(mempoolstats["averageFee"], currencyFormatType)} td(class="monospace") #{utils.formatCurrencyAmount(mempoolstats["averageFee"], currencyFormatType)}
@ -41,6 +42,7 @@ block content
th(class="table-active properties-header") Average Fee per Byte th(class="table-active properties-header") Average Fee per Byte
td(class="monospace") #{utils.formatCurrencyAmountInSmallestUnits(mempoolstats["averageFeePerByte"])}/B td(class="monospace") #{utils.formatCurrencyAmountInSmallestUnits(mempoolstats["averageFeePerByte"])}/B
if (getmempoolinfo.size > 0)
h4 Transactions by fee rate h4 Transactions by fee rate
hr hr
@ -102,6 +104,7 @@ block content
th Fee Rate th Fee Rate
th(class="text-right") Tx Count th(class="text-right") Tx Count
th(class="text-right") Total Fees th(class="text-right") Total Fees
th(class="text-right") Average Fee
th(class="text-right") Average Fee Rate th(class="text-right") Average Fee Rate
tbody tbody
each item, index in mempoolstats["satoshiPerByteBuckets"] each item, index in mempoolstats["satoshiPerByteBuckets"]
@ -111,8 +114,17 @@ block content
td(class="text-right monospace") #{utils.formatCurrencyAmount(item["totalFees"], currencyFormatType)} td(class="text-right monospace") #{utils.formatCurrencyAmount(item["totalFees"], currencyFormatType)}
if (item["totalBytes"] > 0) if (item["totalBytes"] > 0)
- var avgFee = item["totalFees"] / item["count"];
- var avgFeeRate = item["totalFees"] / item["totalBytes"]; - var avgFeeRate = item["totalFees"] / item["totalBytes"];
td(class="text-right monospace") #{utils.formatCurrencyAmount(avgFee, currencyFormatType)}
if (global.exchangeRate)
span
span(data-toggle="tooltip", title=utils.formatExchangedCurrency(avgFee))
i(class="fas fa-exchange-alt")
td(class="text-right monospace") #{utils.formatCurrencyAmountInSmallestUnits(avgFeeRate)}/B td(class="text-right monospace") #{utils.formatCurrencyAmountInSmallestUnits(avgFeeRate)}/B
else else
td(class="text-right monospace") - td(class="text-right monospace") -
td(class="text-right monospace") -
Loading…
Cancel
Save