Merge pull request #910 from mempool/simon/liquid-fee-ranges

Display lower <1 s/vB fee rate tiers for Liquid
This commit is contained in:
wiz 2021-11-17 17:01:29 +09:00 committed by GitHub
commit 6ad4e655ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 3 deletions

View File

@ -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 {

View File

@ -352,9 +352,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]}`);
}
}
}
}