From 26a540a57c899ce0634d7c9816557d9d644d2c86 Mon Sep 17 00:00:00 2001 From: softsimon Date: Wed, 10 Nov 2021 00:04:58 +0400 Subject: [PATCH] Display lower <1 s/vB fee rate tiers for Liquid fixes #859 --- backend/src/api/statistics.ts | 11 ++++++++++- .../mempool-graph/mempool-graph.component.ts | 12 ++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/backend/src/api/statistics.ts b/backend/src/api/statistics.ts index 31b9f7127..7f539ef22 100644 --- a/backend/src/api/statistics.ts +++ b/backend/src/api/statistics.ts @@ -3,6 +3,7 @@ import { DB } from '../database'; import logger from '../logger'; import { Statistic, TransactionExtended, OptimizedStatistic } from '../mempool.interfaces'; +import config from '../config'; class Statistics { protected intervalTimer: NodeJS.Timer | undefined; @@ -87,7 +88,15 @@ class Statistics { memPoolArray.forEach((transaction) => { for (let i = 0; i < logFees.length; i++) { - if ((logFees[i] === 2000 && transaction.effectiveFeePerVsize >= 2000) || transaction.effectiveFeePerVsize <= logFees[i]) { + if ( + (config.MEMPOOL.NETWORK === 'liquid' + && ((logFees[i] === 2000 && transaction.effectiveFeePerVsize * 10 >= 2000) + || transaction.effectiveFeePerVsize * 10 <= logFees[i])) + || + (config.MEMPOOL.NETWORK !== 'liquid' + && ((logFees[i] === 2000 && transaction.effectiveFeePerVsize >= 2000) + || transaction.effectiveFeePerVsize <= logFees[i])) + ) { if (weightVsizeFees[logFees[i]]) { weightVsizeFees[logFees[i]] += transaction.vsize; } else { diff --git a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts index d16f8c534..4b730def4 100644 --- a/frontend/src/app/components/mempool-graph/mempool-graph.component.ts +++ b/frontend/src/app/components/mempool-graph/mempool-graph.component.ts @@ -349,9 +349,17 @@ export class MempoolGraphComponent implements OnInit, OnChanges { } if (feeLevels[i] <= this.limitFee) { if (i === 0) { - this.feeLevelsOrdered.push('0 - 1'); + if (this.stateService.network === 'liquid') { + this.feeLevelsOrdered.push('0 - 0.1'); + } else { + this.feeLevelsOrdered.push('0 - 1'); + } } else { - this.feeLevelsOrdered.push(`${feeLevels[i - 1]} - ${feeLevels[i]}`); + if (this.stateService.network === 'liquid') { + this.feeLevelsOrdered.push(`${feeLevels[i - 1] / 10} - ${feeLevels[i] / 10}`); + } else { + this.feeLevelsOrdered.push(`${feeLevels[i - 1]} - ${feeLevels[i]}`); + } } } }