diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index 557bc1b14..22916b242 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -639,7 +639,7 @@ }
- @if (accelerationInfo?.acceleratedFeeRate && (!tx.effectiveFeePerVsize || accelerationInfo.acceleratedFeeRate >= tx.effectiveFeePerVsize)) { + @if (accelerationInfo?.acceleratedFeeRate && (!tx.effectiveFeePerVsize || accelerationInfo.acceleratedFeeRate >= tx.effectiveFeePerVsize || tx.acceleration)) { } @else { diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts index 756a13c59..67ab8ce01 100644 --- a/frontend/src/app/components/transaction/transaction.component.ts +++ b/frontend/src/app/components/transaction/transaction.component.ts @@ -132,6 +132,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { tooltipPosition: { x: number, y: number }; isMobile: boolean; firstLoad = true; + waitingForAccelerationInfo: boolean = false; featuresEnabled: boolean; segwitEnabled: boolean; @@ -317,11 +318,19 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { this.setIsAccelerated(); }), switchMap((blockHeight: number) => { - return this.servicesApiService.getAccelerationHistory$({ blockHeight }); + return this.servicesApiService.getAccelerationHistory$({ blockHeight }).pipe( + switchMap((accelerationHistory: Acceleration[]) => { + if (this.tx.acceleration && !accelerationHistory.length) { // If the just mined transaction was accelerated, but services backend did not return any acceleration data, retry + return throwError('retry'); + } + return of(accelerationHistory); + }), + retry({ count: 3, delay: 2000 }), + catchError(() => { + return of([]); + }) + ); }), - catchError(() => { - return of([]); - }) ).subscribe((accelerationHistory) => { for (const acceleration of accelerationHistory) { if (acceleration.txid === this.txId && (acceleration.status === 'completed' || acceleration.status === 'completed_provisional')) { @@ -330,6 +339,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { acceleration.boost = boostCost; this.tx.acceleratedAt = acceleration.added; this.accelerationInfo = acceleration; + this.waitingForAccelerationInfo = false; this.setIsAccelerated(); } } @@ -608,6 +618,9 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { this.stateService.txConfirmed$.subscribe(([txConfirmed, block]) => { if (txConfirmed && this.tx && !this.tx.status.confirmed && txConfirmed === this.tx.txid) { + if (this.tx.acceleration) { + this.waitingForAccelerationInfo = true; + } this.tx.status = { confirmed: true, block_height: block.height, @@ -803,7 +816,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { } setIsAccelerated(initialState: boolean = false) { - this.isAcceleration = (this.tx.acceleration || (this.accelerationInfo && this.pool && this.accelerationInfo.pools.some(pool => (pool === this.pool.id)))); + this.isAcceleration = ((this.tx.acceleration && (!this.tx.status.confirmed || this.waitingForAccelerationInfo)) || (this.accelerationInfo && this.pool && this.accelerationInfo.pools.some(pool => (pool === this.pool.id)))); if (this.isAcceleration) { if (initialState) { this.accelerationFlowCompleted = true;