Remodeling how historical fees are stored and presented.

fixes #908
This commit is contained in:
softsimon
2021-11-29 22:54:13 +04:00
parent 6113d3a5bf
commit ef96250b49
3 changed files with 10 additions and 40 deletions

View File

@@ -85,17 +85,14 @@ class Statistics {
250, 300, 350, 400, 500, 600, 700, 800, 900, 1000, 1200, 1400, 1600, 1800, 2000];
const weightVsizeFees: { [feePerWU: number]: number } = {};
const lastItem = logFees.length - 1;
memPoolArray.forEach((transaction) => {
for (let i = 0; i < logFees.length; i++) {
if (
(config.MEMPOOL.NETWORK === 'liquid'
&& ((logFees[i] === 2000 && transaction.effectiveFeePerVsize * 10 >= 2000)
|| transaction.effectiveFeePerVsize * 10 <= logFees[i]))
(config.MEMPOOL.NETWORK === 'liquid' && (i === lastItem || transaction.effectiveFeePerVsize * 10 < logFees[i + 1]))
||
(config.MEMPOOL.NETWORK !== 'liquid'
&& ((logFees[i] === 2000 && transaction.effectiveFeePerVsize >= 2000)
|| transaction.effectiveFeePerVsize <= logFees[i]))
(config.MEMPOOL.NETWORK !== 'liquid' && (i === lastItem || transaction.effectiveFeePerVsize < logFees[i + 1]))
) {
if (weightVsizeFees[logFees[i]]) {
weightVsizeFees[logFees[i]] += transaction.vsize;