From f21585782fd604b9b96a856a92f75a90138f4f8e Mon Sep 17 00:00:00 2001 From: softsimon Date: Fri, 27 Mar 2020 17:56:42 +0700 Subject: [PATCH] Adding unfairly cheap for very low fee transactions. --- .../app/components/transaction/transaction.component.html | 1 + .../src/app/components/transaction/transaction.component.ts | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index f135e441a..faf16284e 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -59,6 +59,7 @@ {{ tx.fee / (tx.weight / 4) | number : '1.1-1' }} sats/vB   + Unfairly cheap Optimal Overpaid {{ overpaidTimes }}x Overpaid {{ overpaidTimes }}x diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts index faa7b7839..a61ec1010 100644 --- a/frontend/src/app/components/transaction/transaction.component.ts +++ b/frontend/src/app/components/transaction/transaction.component.ts @@ -116,7 +116,7 @@ export class TransactionComponent implements OnInit, OnDestroy { for (const block of mempoolBlocks) { for (let i = 0; i < block.feeRange.length - 1; i++) { - if (txFeePerVSize < block.feeRange[i + 1] && txFeePerVSize >= block.feeRange[i]) { + if (txFeePerVSize <= block.feeRange[i + 1] && txFeePerVSize >= block.feeRange[i]) { this.txInBlockIndex = mempoolBlocks.indexOf(block); } } @@ -148,7 +148,9 @@ export class TransactionComponent implements OnInit, OnDestroy { this.overpaidTimes = Math.round(feePervByte / this.medianFeeNeeded); - if (feePervByte <= this.medianFeeNeeded || this.overpaidTimes < 2) { + if (feePervByte < 0.9) { + this.feeRating = 0; + } else if (feePervByte <= this.medianFeeNeeded || this.overpaidTimes < 2) { this.feeRating = 1; } else { this.feeRating = 2;