Adding unfairly cheap for very low fee transactions.

This commit is contained in:
softsimon 2020-03-27 17:56:42 +07:00
parent fccfa202e1
commit f21585782f
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
2 changed files with 5 additions and 2 deletions

View File

@ -59,6 +59,7 @@
<td>
{{ tx.fee / (tx.weight / 4) | number : '1.1-1' }} sats/vB
&nbsp;
<span *ngIf="feeRating === 0" class="badge badge-success">Unfairly cheap</span>
<span *ngIf="feeRating === 1" class="badge badge-success">Optimal</span>
<span *ngIf="feeRating === 2" class="badge badge-warning" title="Only ~{{ medianFeeNeeded }} sat/vB was needed to get into this block">Overpaid {{ overpaidTimes }}x</span>
<span *ngIf="feeRating === 3" class="badge badge-danger" title="Only ~{{ medianFeeNeeded }} sat/vB was needed to get into this block">Overpaid {{ overpaidTimes }}x</span>

View File

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