From 4ab05388e946c74c36b897730206179ecb018ff1 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Sat, 25 Nov 2023 11:56:28 +0000 Subject: [PATCH] Select rounder numbers for acceleration bid options --- .../accelerate-preview/accelerate-preview.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts index 530977c71..0ff9f655b 100644 --- a/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts +++ b/frontend/src/app/components/accelerate-preview/accelerate-preview.component.ts @@ -103,7 +103,11 @@ export class AcceleratePreviewComponent implements OnInit, OnDestroy, OnChanges this.hasAncestors = this.estimate.txSummary.ancestorCount > 1; // Make min extra fee at least 50% of the current tx fee - this.minExtraCost = nextRoundNumber(Math.max(this.estimate.cost * 2, this.estimate.txSummary.effectiveFee)); + const baseFees = (this.estimate.mempoolBaseFee + this.estimate.vsizeFee); + const bidBasis = Math.max(this.estimate.cost * 2, this.estimate.txSummary.effectiveFee); + const roundingAdjustment = (bidBasis >= baseFees) ? baseFees : 0; + const roundedBidBasis = nextRoundNumber(bidBasis + roundingAdjustment); + this.minExtraCost = roundedBidBasis - roundingAdjustment; this.maxRateOptions = [1, 2, 4].map((multiplier, index) => { return {