@@ -1,6 +1,14 @@
|
||||
<div class="container-xl">
|
||||
|
||||
<div class="title-block">
|
||||
<div *ngIf="rbfTransaction" class="alert alert-mempool" role="alert">
|
||||
This transaction has been replaced by:
|
||||
<a class="alert-link" [routerLink]="['/tx/' | relativeUrl, rbfTransaction.txid]" [state]="{ data: rbfTransaction }">
|
||||
<span class="d-inline d-lg-none">{{ rbfTransaction.txid | shortenString : 24 }}</span>
|
||||
<span class="d-none d-lg-inline">{{ rbfTransaction.txid }}</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<h1 class="float-left mr-3 mb-md-3">Transaction</h1>
|
||||
|
||||
<ng-template [ngIf]="tx?.status?.confirmed">
|
||||
|
||||
@@ -36,6 +36,7 @@ export class TransactionComponent implements OnInit, OnDestroy {
|
||||
potentialP2shGains: 0,
|
||||
};
|
||||
isRbfTransaction: boolean;
|
||||
rbfTransaction: undefined | Transaction;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
@@ -126,6 +127,9 @@ export class TransactionComponent implements OnInit, OnDestroy {
|
||||
this.audioService.playSound('magic');
|
||||
this.findBlockAndSetFeeRating();
|
||||
});
|
||||
|
||||
this.stateService.txReplaced$
|
||||
.subscribe((rbfTransaction) => this.rbfTransaction = rbfTransaction);
|
||||
}
|
||||
|
||||
handleLoadElectrsTransactionError(error: any): Observable<any> {
|
||||
@@ -198,6 +202,7 @@ export class TransactionComponent implements OnInit, OnDestroy {
|
||||
this.feeRating = undefined;
|
||||
this.waitingForTransaction = false;
|
||||
this.isLoadingTx = true;
|
||||
this.rbfTransaction = undefined;
|
||||
this.transactionTime = -1;
|
||||
document.body.scrollTo(0, 0);
|
||||
this.leaveTransaction();
|
||||
|
||||
@@ -11,6 +11,7 @@ export interface WebsocketResponse {
|
||||
action?: string;
|
||||
data?: string[];
|
||||
tx?: Transaction;
|
||||
rbfTransaction?: Transaction;
|
||||
'track-tx'?: string;
|
||||
'track-address'?: string;
|
||||
'track-asset'?: string;
|
||||
|
||||
@@ -24,6 +24,7 @@ export class StateService {
|
||||
mempoolStats$ = new ReplaySubject<MemPoolState>(1);
|
||||
mempoolBlocks$ = new ReplaySubject<MempoolBlock[]>(1);
|
||||
txConfirmed$ = new Subject<Block>();
|
||||
txReplaced$ = new Subject<Transaction>();
|
||||
mempoolTransactions$ = new Subject<Transaction>();
|
||||
blockTransactions$ = new Subject<Transaction>();
|
||||
|
||||
|
||||
@@ -89,6 +89,10 @@ export class WebsocketService {
|
||||
this.stateService.conversions$.next(response.conversions);
|
||||
}
|
||||
|
||||
if (response.rbfTransaction) {
|
||||
this.stateService.txReplaced$.next(response.rbfTransaction);
|
||||
}
|
||||
|
||||
if (response['mempool-blocks']) {
|
||||
this.stateService.mempoolBlocks$.next(response['mempool-blocks']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user