From 3088befbf5094c5b90d9227bd695c11ef372b45b Mon Sep 17 00:00:00 2001 From: Mononaut Date: Mon, 1 Jul 2024 05:18:19 +0000 Subject: [PATCH 1/9] remove btcpay.svg --- frontend/src/resources/btcpay.svg | 1 - 1 file changed, 1 deletion(-) delete mode 100644 frontend/src/resources/btcpay.svg diff --git a/frontend/src/resources/btcpay.svg b/frontend/src/resources/btcpay.svg deleted file mode 100644 index 5d8592b71..000000000 --- a/frontend/src/resources/btcpay.svg +++ /dev/null @@ -1 +0,0 @@ -btcpay3 \ No newline at end of file From 69b346ab00a9fc2efffb472826dc21c378e36f3c Mon Sep 17 00:00:00 2001 From: Mononaut Date: Mon, 1 Jul 2024 05:24:21 +0000 Subject: [PATCH 2/9] move CPFP panel above accelerator --- .../transaction/transaction.component.html | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index da8763fa6..c3e5f95e8 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -74,38 +74,9 @@ - - -
-
-

Accelerate

-
- - - - -
- - - - -
- +
-

CPFP

@@ -161,6 +132,35 @@ + + +
+
+

Accelerate

+
+ + + + +
+ + + + +
+
From da4c2f53072612ba5c33a6a447e60872455e3509 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Mon, 1 Jul 2024 05:45:32 +0000 Subject: [PATCH 3/9] [accelerator] remove safety catch, always show checkout --- .../accelerate-checkout.component.html | 54 ++++++++++++------- .../accelerate-checkout.component.scss | 19 ------- .../accelerate-checkout.component.ts | 24 ++------- 3 files changed, 37 insertions(+), 60 deletions(-) diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.html b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.html index a0f84e226..b727d3af2 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.html +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.html @@ -283,11 +283,9 @@
-
-
- -
@@ -338,18 +336,20 @@
- @if (canPayWithBalance || !(canPayWithBitcoin || canPayWithCashapp)) { -
- +
+
+

Payment to mempool.space for acceleration of txid {{ tx.txid.substr(0, 10) }}..{{ tx.txid.substr(-10) }}

- } @else { -
-
-

Payment to mempool.space for acceleration of txid {{ tx.txid.substr(0, 10) }}..{{ tx.txid.substr(-10) }}

+ @if (canPayWithBalance || !(canPayWithBitcoin || canPayWithCashapp)) { +
+
+

Your account will be debited no more than {{ cost | number }} sats

+
+ +
+
+ } @else {
@if (canPayWithBitcoin) {
@@ -376,8 +376,8 @@
}
-
- } + } +
@@ -487,12 +487,12 @@
- + @if (isLoggedIn() || canPayWithBitcoin || canPayWithCashapp) { - @@ -502,4 +502,18 @@ Coming soon } + + + + @if (isLoggedIn()) { + + } @else { + + } \ No newline at end of file diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.scss b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.scss index 5cfd153bd..5b302b9ad 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.scss +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.scss @@ -189,22 +189,3 @@ flex-direction: column; } } - -@keyframes box-shake { - 0% { transform: rotate(0deg); } - 10% { transform: rotate(-8deg); } - 20% { transform: rotate(8deg); } - 30% { transform: rotate(-8deg); } - 40% { transform: rotate(8deg); } - 50% { transform: rotate(-8deg); } - 60% { transform: rotate(8deg); } - 70% { transform: rotate(-8deg); } - 80% { transform: rotate(8deg); } - 90% { transform: rotate(-8deg); } - 100% { transform: rotate(0deg); } -} - -.error-shake { - box-shadow: 0 0 10px 2px var(--danger); - animation: box-shake 1.5s ease-in-out; -} \ No newline at end of file diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts index 8c0d35dd9..5db585381 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts @@ -62,8 +62,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy { @Output() changeMode = new EventEmitter(); calculating = true; - armed = false; - misfire = false; error = ''; math = Math; isMobile: boolean = window.innerWidth <= 767.98; @@ -150,7 +148,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy { moveToStep(step: CheckoutStep) { this._step = step; - this.misfire = false; if (!this.estimate && ['quote', 'summary', 'checkout'].includes(this.step)) { this.fetchEstimate(); } @@ -265,28 +262,13 @@ export class AccelerateCheckout implements OnInit, OnDestroy { } } - /** - * Advanced mode acceleration button clicked - */ - accelerate(): void { - if (this.canPay && !this.calculating) { - if ((!this.armed && this.step === 'summary')) { - this.misfire = true; - } else { - if (this.isLoggedIn()) { - this.accelerateWithMempoolAccount(); - } else { - this.armed = true; - this.moveToStep('checkout'); - } - } - } - } - /** * Account-based acceleration request */ accelerateWithMempoolAccount(): void { + if (!this.canPay || this.calculating) { + return; + } if (this.accelerationSubscription) { this.accelerationSubscription.unsubscribe(); } From a624e8263013967c404d9f79118767cd087da3e7 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Mon, 1 Jul 2024 06:19:11 +0000 Subject: [PATCH 4/9] [accelerator] restore "wait" radio on pizza tracker --- .../accelerate-checkout.component.html | 73 ++++++++++++++----- .../accelerate-checkout.component.ts | 8 ++ 2 files changed, 63 insertions(+), 18 deletions(-) diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.html b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.html index b727d3af2..b1313613d 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.html +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.html @@ -280,29 +280,55 @@
You are currently on the waitlist for Mempool Accelerator™
- -
-
-
-
- Accelerate to ~{{ ((userBid + estimate.txSummary.effectiveFee) / estimate.txSummary.effectiveVsize) | number : '1.0-0' }} sat/vB - Confirmation expected
- @if (!calculating) { - fee ({{ cost | number }} sats) + @if (!advancedEnabled) { + +
+
+
+ + +
+
+ +
-
- Your transaction will be prioritized by up to {{ etaInfo.hashratePercentage | number : '1.1-1' }}% of miners. - +
+
+ +
+
+ + } @else { +
+
+
+
+
+ +
+
+
+
+ Your transaction will be prioritized by up to {{ etaInfo.hashratePercentage | number : '1.1-1' }}% of miners. + +
+
-
- + }
@@ -486,13 +512,24 @@ }
+ + Accelerate to ~{{ ((userBid + estimate.txSummary.effectiveFee) / estimate.txSummary.effectiveVsize) | number : '1.0-0' }} sat/vB + Confirmation expected
+ @if (!calculating) { + fee ({{ cost | number }} sats) + } @else { + Calculating cost... + } +
+
+ @if (isLoggedIn() || canPayWithBitcoin || canPayWithCashapp) { - @@ -506,7 +543,7 @@ @if (isLoggedIn()) { - diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts index 5db585381..e8d3a3237 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts @@ -62,6 +62,7 @@ export class AccelerateCheckout implements OnInit, OnDestroy { @Output() changeMode = new EventEmitter(); calculating = true; + selectedOption: 'wait' | 'accel'; error = ''; math = Math; isMobile: boolean = window.innerWidth <= 767.98; @@ -451,6 +452,13 @@ export class AccelerateCheckout implements OnInit, OnDestroy { return auth !== null; } + /** + * UI events + */ + selectedOptionChanged(event) { + this.selectedOption = event.target.id; + } + get step() { return this._step; } From 23fa28567df37e69b13933a416ab993d1bca8a18 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Mon, 1 Jul 2024 06:19:29 +0000 Subject: [PATCH 5/9] [accelerator] toggle button alignment --- .../src/app/components/transaction/transaction.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index c3e5f95e8..606f49c7f 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -139,8 +139,8 @@

Accelerate

- - + +
From c71a0afe1f5a428112a7864cd584055a5fd62a86 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Mon, 1 Jul 2024 06:44:03 +0000 Subject: [PATCH 6/9] [accelerator] remember hide accelerator preference --- .../transaction/transaction.component.ts | 56 ++++++++++++------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts index 3bc40ea93..b242747cd 100644 --- a/frontend/src/app/components/transaction/transaction.component.ts +++ b/frontend/src/app/components/transaction/transaction.component.ts @@ -137,10 +137,11 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { hasEffectiveFeeRate: boolean; accelerateCtaType: 'alert' | 'button' = 'button'; acceleratorAvailable: boolean = this.stateService.env.ACCELERATOR && this.stateService.network === ''; - showAccelerationSummary = false; + forceAccelerationSummary = false; + hideAccelerationSummary = false; + accelerationFlowCompleted = false; showAccelerationDetails = false; hasAccelerationDetails = false; - accelerationFlowCompleted = false; scrollIntoAccelPreview = false; accelerationEligible = false; auditEnabled: boolean = this.stateService.env.AUDIT && this.stateService.env.BASE_MODULE === 'mempool' && this.stateService.env.MINING_DASHBOARD === true; @@ -173,11 +174,11 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { this.enterpriseService.page(); const urlParams = new URLSearchParams(window.location.search); - if (urlParams.get('cash_request_id')) { - this.showAccelerationSummary = true; - } + this.forceAccelerationSummary = !!urlParams.get('cash_request_id'); - if (!this.stateService.isLiquid) { + this.hideAccelerationSummary = this.storageService.getValue('hide-accelerator-pref') == 'true'; + + if (!this.stateService.isLiquid()) { this.miningService.getMiningStats('1w').subscribe(stats => { this.miningStats = stats; }); @@ -414,8 +415,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { if (this.stateService.network === '') { if (!this.mempoolPosition.accelerated) { - if (!this.accelerationFlowCompleted && !this.showAccelerationSummary) { - this.showAccelerationSummary = true; + if (!this.accelerationFlowCompleted && !this.hideAccelerationSummary && !this.showAccelerationSummary) { this.miningService.getMiningStats('1w').subscribe(stats => { this.miningStats = stats; }); @@ -425,7 +425,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { } } else if (this.showAccelerationSummary) { setTimeout(() => { - this.closeAccelerator(); + this.accelerationFlowCompleted = true; }, 2000); } } @@ -715,8 +715,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { document.location.hash = '#accelerate'; this.enterpriseService.goal(8); - this.accelerationFlowCompleted = false; - this.showAccelerationSummary = this.acceleratorAvailable; + this.openAccelerator(); this.scrollIntoAccelPreview = true; return false; } @@ -778,7 +777,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { } if (!this.isAcceleration && this.fragmentParams.has('accelerate')) { - this.onAccelerateClicked(); + this.forceAccelerationSummary = true; } this.txChanged$.next(true); @@ -797,10 +796,9 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { if (this.isAcceleration) { if (initialState) { this.accelerationFlowCompleted = true; - this.showAccelerationSummary = false; } else if (this.showAccelerationSummary) { setTimeout(() => { - this.closeAccelerator(); + this.accelerationFlowCompleted = true; }, 2000); } } @@ -890,11 +888,6 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { this.stateService.markBlock$.next({}); } - closeAccelerator(): void { - this.accelerationFlowCompleted = true; - this.showAccelerationSummary = false; - } - roundToOneDecimal(cpfpTx: any): number { return +(cpfpTx.fee / (cpfpTx.weight / 4)).toFixed(1); } @@ -963,6 +956,31 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { return auth !== null; } + closeAccelerator(): void { + document.location.hash = ''; + this.hideAccelerationSummary = true; + this.forceAccelerationSummary = false; + this.storageService.setValue('hide-accelerator-pref', 'true'); + } + + openAccelerator(): void { + this.accelerationFlowCompleted = false; + this.hideAccelerationSummary = false; + this.storageService.setValue('hide-accelerator-pref', 'false'); + } + + get showAccelerationSummary(): boolean { + return ( + this.tx + && !this.tx.acceleration + && this.acceleratorAvailable + && ( + (!this.hideAccelerationSummary && !this.accelerationFlowCompleted) + || this.forceAccelerationSummary + ) + ); + } + ngOnDestroy() { this.subscription.unsubscribe(); this.fetchCpfpSubscription.unsubscribe(); From e35ac6e1a2ca0cfd2b26b81be874540fd099e83a Mon Sep 17 00:00:00 2001 From: Mononaut Date: Mon, 1 Jul 2024 07:28:25 +0000 Subject: [PATCH 7/9] [accelerator] check for input replaceability --- .../components/tracker/tracker.component.html | 2 +- .../components/tracker/tracker.component.ts | 58 +++++++++++-------- .../transaction/transaction.component.html | 2 +- .../transaction/transaction.component.ts | 23 ++++++-- 4 files changed, 54 insertions(+), 31 deletions(-) diff --git a/frontend/src/app/components/tracker/tracker.component.html b/frontend/src/app/components/tracker/tracker.component.html index a0f242d46..628214ce5 100644 --- a/frontend/src/app/components/tracker/tracker.component.html +++ b/frontend/src/app/components/tracker/tracker.component.html @@ -122,7 +122,7 @@   } @else if (showAccelerationSummary) { - + } @else { @if (tx?.acceleration && !tx.status?.confirmed) { diff --git a/frontend/src/app/components/tracker/tracker.component.ts b/frontend/src/app/components/tracker/tracker.component.ts index 349e8d43b..ed386b927 100644 --- a/frontend/src/app/components/tracker/tracker.component.ts +++ b/frontend/src/app/components/tracker/tracker.component.ts @@ -21,7 +21,7 @@ import { AudioService } from '../../services/audio.service'; import { ApiService } from '../../services/api.service'; import { SeoService } from '../../services/seo.service'; import { seoDescriptionNetwork } from '../../shared/common.utils'; -import { Filter } from '../../shared/filters.utils'; +import { Filter, TransactionFlags } from '../../shared/filters.utils'; import { BlockExtended, CpfpInfo, RbfTree, MempoolPosition, DifficultyAdjustment, Acceleration, AccelerationPosition } from '../../interfaces/node-api.interface'; import { PriceService } from '../../services/price.service'; import { ServicesApiServices } from '../../services/services-api.service'; @@ -30,7 +30,7 @@ import { ZONE_SERVICE } from '../../injection-tokens'; import { TrackerStage } from './tracker-bar.component'; import { MiningService, MiningStats } from '../../services/mining.service'; import { ETA, EtaService } from '../../services/eta.service'; -import { getUnacceleratedFeeRate } from '../../shared/transaction.utils'; +import { getTransactionFlags, getUnacceleratedFeeRate } from '../../shared/transaction.utils'; interface Pool { id: number; @@ -117,8 +117,7 @@ export class TrackerComponent implements OnInit, OnDestroy { hasEffectiveFeeRate: boolean; accelerateCtaType: 'alert' | 'button' = 'button'; acceleratorAvailable: boolean = this.stateService.env.ACCELERATOR && this.stateService.network === ''; - accelerationEligible: boolean = false; - showAccelerationSummary = false; + eligibleForAcceleration: boolean = false; accelerationFlowCompleted = false; scrollIntoAccelPreview = false; auditEnabled: boolean = this.stateService.env.AUDIT && this.stateService.env.BASE_MODULE === 'mempool' && this.stateService.env.MINING_DASHBOARD === true; @@ -155,11 +154,6 @@ export class TrackerComponent implements OnInit, OnDestroy { this.miningStats = stats; }); - const urlParams = new URLSearchParams(window.location.search); - if (urlParams.get('cash_request_id')) { - this.showAccelerationSummary = true; - } - this.enterpriseService.page(); this.enterpriseInfo$ = this.enterpriseService.info$.subscribe(info => { @@ -267,6 +261,7 @@ export class TrackerComponent implements OnInit, OnDestroy { if (!this.tx) { this.tx = tx; + this.checkAccelerationEligibility(); this.isCached = true; if (tx.fee === undefined) { this.tx.fee = 0; @@ -385,20 +380,9 @@ export class TrackerComponent implements OnInit, OnDestroy { this.trackerStage = 'replaced'; } - if (!this.mempoolPosition.accelerated) { - if (!this.accelerationFlowCompleted && !this.showAccelerationSummary && this.mempoolPosition.block > 0) { - this.showAccelerationSummary = true; - this.miningService.getMiningStats('1w').subscribe(stats => { - this.miningStats = stats; - }); - } - if (txPosition.position?.block > 0) { - this.accelerationEligible = true; - } - } else if (this.showAccelerationSummary) { + if (this.mempoolPosition.accelerated && this.showAccelerationSummary) { setTimeout(() => { this.accelerationFlowCompleted = true; - this.showAccelerationSummary = false; }, 2000); } } @@ -462,6 +446,7 @@ export class TrackerComponent implements OnInit, OnDestroy { this.seoService.clearSoft404(); this.tx = tx; + this.checkAccelerationEligibility(); this.isCached = false; if (tx.fee === undefined) { this.tx.fee = 0; @@ -744,8 +729,9 @@ export class TrackerComponent implements OnInit, OnDestroy { } this.enterpriseService.goal(8); this.accelerationFlowCompleted = false; - this.showAccelerationSummary = true && this.acceleratorAvailable; - this.scrollIntoAccelPreview = true; + if (this.showAccelerationSummary) { + this.scrollIntoAccelPreview = true; + } return false; } @@ -753,6 +739,30 @@ export class TrackerComponent implements OnInit, OnDestroy { return this.isLoadingTx || this.loadingCachedTx || this.loadingPosition; } + checkAccelerationEligibility() { + if (this.tx) { + this.tx.flags = getTransactionFlags(this.tx); + const replaceableInputs = (this.tx.flags & (TransactionFlags.sighash_none | TransactionFlags.sighash_acp)) > 0n; + this.eligibleForAcceleration = !replaceableInputs; + } else { + this.eligibleForAcceleration = false; + } + } + + get cashappEligible(): boolean { + return this.mempoolPosition?.block > 0; + } + + get showAccelerationSummary(): boolean { + return ( + this.tx + && !this.tx.acceleration + && this.acceleratorAvailable + && this.eligibleForAcceleration + && !this.accelerationFlowCompleted + ); + } + resetTransaction() { this.error = undefined; this.tx = null; @@ -778,7 +788,7 @@ export class TrackerComponent implements OnInit, OnDestroy { this.pool = null; this.auditStatus = null; this.accelerationPositions = null; - this.accelerationEligible = false; + this.eligibleForAcceleration = false; this.trackerStage = 'waiting'; document.body.scrollTo(0, 0); this.leaveTransaction(); diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index 606f49c7f..2e1c2a519 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -147,7 +147,7 @@ 0 && this.tx.weight < 4000) { - this.accelerationEligible = true; + this.cashappEligible = true; } } else if (this.showAccelerationSummary) { setTimeout(() => { @@ -819,6 +820,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { this.rbfEnabled = !this.tx.status.confirmed || isFeatureActive(this.stateService.network, this.tx.status.block_height, 'rbf'); this.tx.flags = getTransactionFlags(this.tx); this.filters = this.tx.flags ? toFilters(this.tx.flags).filter(f => f.txPage) : []; + this.checkAccelerationEligibility(); } else { this.segwitEnabled = false; this.taprootEnabled = false; @@ -827,6 +829,15 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { this.featuresEnabled = this.segwitEnabled || this.taprootEnabled || this.rbfEnabled; } + checkAccelerationEligibility() { + if (this.tx && this.tx.flags) { + const replaceableInputs = (this.tx.flags & (TransactionFlags.sighash_none | TransactionFlags.sighash_acp)) > 0n; + this.eligibleForAcceleration = !replaceableInputs; + } else { + this.eligibleForAcceleration = false; + } + } + isAuditAvailable(blockHeight: number): boolean { if (!this.auditEnabled) { return false; @@ -871,7 +882,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { this.showCpfpDetails = false; this.showAccelerationDetails = false; this.accelerationInfo = null; - this.accelerationEligible = false; + this.cashappEligible = false; this.txInBlockIndex = null; this.mempoolPosition = null; this.pool = null; @@ -880,6 +891,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { document.body.scrollTo(0, 0); this.isAcceleration = false; this.isAccelerated$.next(this.isAcceleration); + this.eligibleForAcceleration = false; this.leaveTransaction(); } @@ -974,6 +986,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { this.tx && !this.tx.acceleration && this.acceleratorAvailable + && this.eligibleForAcceleration && ( (!this.hideAccelerationSummary && !this.accelerationFlowCompleted) || this.forceAccelerationSummary From 5067c88642d000cd9266188e4a622359c06672b7 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Mon, 1 Jul 2024 07:39:28 +0000 Subject: [PATCH 8/9] [accelerator] check for high sigops --- frontend/src/app/components/tracker/tracker.component.ts | 3 ++- .../src/app/components/transaction/transaction.component.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/tracker/tracker.component.ts b/frontend/src/app/components/tracker/tracker.component.ts index ed386b927..64991b8ed 100644 --- a/frontend/src/app/components/tracker/tracker.component.ts +++ b/frontend/src/app/components/tracker/tracker.component.ts @@ -743,7 +743,8 @@ export class TrackerComponent implements OnInit, OnDestroy { if (this.tx) { this.tx.flags = getTransactionFlags(this.tx); const replaceableInputs = (this.tx.flags & (TransactionFlags.sighash_none | TransactionFlags.sighash_acp)) > 0n; - this.eligibleForAcceleration = !replaceableInputs; + const highSigop = (this.tx.sigops * 20) > this.tx.weight; + this.eligibleForAcceleration = !replaceableInputs && !highSigop; } else { this.eligibleForAcceleration = false; } diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts index d8aafc319..93c91ef4b 100644 --- a/frontend/src/app/components/transaction/transaction.component.ts +++ b/frontend/src/app/components/transaction/transaction.component.ts @@ -832,7 +832,8 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { checkAccelerationEligibility() { if (this.tx && this.tx.flags) { const replaceableInputs = (this.tx.flags & (TransactionFlags.sighash_none | TransactionFlags.sighash_acp)) > 0n; - this.eligibleForAcceleration = !replaceableInputs; + const highSigop = (this.tx.sigops * 20) > this.tx.weight; + this.eligibleForAcceleration = !replaceableInputs && !highSigop; } else { this.eligibleForAcceleration = false; } From 396eee35553f05f4f635a4a79726612f970f0e63 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Mon, 1 Jul 2024 07:42:57 +0000 Subject: [PATCH 9/9] [accelerator] hide accelerate button for ineligible txs --- .../app/components/transaction/transaction.component.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index 2e1c2a519..b3524b615 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -551,18 +551,18 @@
@if (eta.blocks >= 7) { - + In several hours (or more) - @if (!tx?.acceleration && acceleratorAvailable && accelerateCtaType === 'button' && !showAccelerationSummary) { + @if (!tx?.acceleration && acceleratorAvailable && accelerateCtaType === 'button' && !showAccelerationSummary && eligibleForAcceleration) { Accelerate } } @else if (network === 'liquid' || network === 'liquidtestnet') { } @else { - + - @if (!tx?.acceleration && acceleratorAvailable && accelerateCtaType === 'button' && !showAccelerationSummary) { + @if (!tx?.acceleration && acceleratorAvailable && accelerateCtaType === 'button' && !showAccelerationSummary && eligibleForAcceleration) { Accelerate }