From 6340dc571c6b5ae99eaadd275beddbe49502c3f2 Mon Sep 17 00:00:00 2001 From: natsoni Date: Sun, 9 Feb 2025 18:13:06 +0100 Subject: [PATCH] Don't show ETA on unbroadcasted txs, and placeholder for missing fee --- .../transaction-details.component.html | 8 +++---- .../transaction-details.component.ts | 1 + .../transaction-raw.component.html | 4 +--- .../transaction/transaction-raw.component.ts | 23 +------------------ 4 files changed, 7 insertions(+), 29 deletions(-) diff --git a/frontend/src/app/components/transaction/transaction-details/transaction-details.component.html b/frontend/src/app/components/transaction/transaction-details/transaction-details.component.html index c5609882c..78bba955c 100644 --- a/frontend/src/app/components/transaction/transaction-details/transaction-details.component.html +++ b/frontend/src/app/components/transaction/transaction-details/transaction-details.component.html @@ -153,7 +153,7 @@ @if (!isLoadingTx) { - @if (!replaced && !isCached) { + @if (!replaced && !isCached && !unbroadcasted) { ETA @@ -184,7 +184,7 @@ } - } @else { + } @else if (!unbroadcasted){ } @@ -213,11 +213,11 @@ @if (!isLoadingTx) { Fee - {{ tx.fee | number }} sats + {{ (tx.fee | number) ?? '-' }} sats @if (isAcceleration && accelerationInfo?.bidBoost ?? tx.feeDelta > 0) { +{{ accelerationInfo?.bidBoost ?? tx.feeDelta | number }} sats } - + } @else { diff --git a/frontend/src/app/components/transaction/transaction-details/transaction-details.component.ts b/frontend/src/app/components/transaction/transaction-details/transaction-details.component.ts index 2b539c154..c6260da48 100644 --- a/frontend/src/app/components/transaction/transaction-details/transaction-details.component.ts +++ b/frontend/src/app/components/transaction/transaction-details/transaction-details.component.ts @@ -38,6 +38,7 @@ export class TransactionDetailsComponent implements OnInit { @Input() replaced: boolean; @Input() isCached: boolean; @Input() ETA$: Observable; + @Input() unbroadcasted: boolean; @Output() accelerateClicked = new EventEmitter(); @Output() toggleCpfp$ = new EventEmitter(); diff --git a/frontend/src/app/components/transaction/transaction-raw.component.html b/frontend/src/app/components/transaction/transaction-raw.component.html index b6286779a..450e18ecd 100644 --- a/frontend/src/app/components/transaction/transaction-raw.component.html +++ b/frontend/src/app/components/transaction/transaction-raw.component.html @@ -58,6 +58,7 @@ } ; mempoolBlocksSubscription: Subscription; constructor( public route: ActivatedRoute, public router: Router, public stateService: StateService, - public etaService: EtaService, public electrsApi: ElectrsApiService, public websocketService: WebsocketService, public formBuilder: UntypedFormBuilder, @@ -195,24 +192,6 @@ export class TransactionRawComponent implements OnInit, OnDestroy { }); this.setGraphSize(); - this.ETA$ = combineLatest([ - this.stateService.mempoolBlocks$.pipe(startWith(null)), - this.stateService.difficultyAdjustment$.pipe(startWith(null)), - ]).pipe( - map(([mempoolBlocks, da]) => { - return this.etaService.calculateETA( - this.stateService.network, - this.transaction, - mempoolBlocks, - null, - da, - null, - null, - null - ); - }) - ); - this.mempoolBlocksSubscription = this.stateService.mempoolBlocks$.subscribe(() => { if (this.transaction) { this.stateService.markBlock$.next({