diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index 4470f30d7..9d46bc76e 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -50,8 +50,8 @@ {{ tx.fee / (tx.weight / 4) | number : '1.2-2' }} sats/vB   Optimal - Overpaid {{ overpaidTimes }}x - Overpaid {{ overpaidTimes }}x + 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 6aa582fb3..bb4fe639a 100644 --- a/frontend/src/app/components/transaction/transaction.component.ts +++ b/frontend/src/app/components/transaction/transaction.component.ts @@ -19,6 +19,7 @@ export class TransactionComponent implements OnInit, OnDestroy { txId: string; feeRating: number; overpaidTimes: number; + medianFeeNeeded: number; isLoadingTx = true; error: any = undefined; latestBlock: Block; @@ -98,16 +99,16 @@ export class TransactionComponent implements OnInit, OnDestroy { .pipe(filter((block) => block.height === this.tx.status.block_height)) .subscribe((block) => { const feePervByte = this.tx.fee / (this.tx.weight / 4); - let medianFee = block.feeRange[Math.round(block.feeRange.length * 0.5)]; + this.medianFeeNeeded = block.feeRange[Math.round(block.feeRange.length * 0.5)]; // Block not filled if (block.weight < 4000000 * 0.95) { - medianFee = 1; + this.medianFeeNeeded = 1; } - this.overpaidTimes = Math.round(feePervByte / block.medianFee); + this.overpaidTimes = Math.round(feePervByte / this.medianFeeNeeded); - if (feePervByte <= medianFee || this.overpaidTimes < 2) { + if (feePervByte <= this.medianFeeNeeded || this.overpaidTimes < 2) { this.feeRating = 1; } else { this.feeRating = 2;