fixes for non-dual-node rbf feature
This commit is contained in:
parent
9e3213ff79
commit
a7f123c3b9
@ -422,7 +422,6 @@ class WebsocketHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(client['track-rbf']);
|
|
||||||
if (client['track-rbf'] === 'all' && rbfReplacements) {
|
if (client['track-rbf'] === 'all' && rbfReplacements) {
|
||||||
response['rbfLatest'] = rbfReplacements;
|
response['rbfLatest'] = rbfReplacements;
|
||||||
} else if (client['track-rbf'] === 'fullRbf' && fullRbfReplacements) {
|
} else if (client['track-rbf'] === 'fullRbf' && fullRbfReplacements) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<div
|
<div
|
||||||
#tooltip
|
#tooltip
|
||||||
*ngIf="rbfInfo"
|
*ngIf="rbfInfo && tooltipPosition !== null"
|
||||||
class="rbf-tooltip"
|
class="rbf-tooltip"
|
||||||
[style.left]="tooltipPosition.x + 'px'"
|
[style.left]="tooltipPosition.x + 'px'"
|
||||||
[style.top]="tooltipPosition.y + 'px'"
|
[style.top]="tooltipPosition.y + 'px'"
|
||||||
|
@ -10,7 +10,7 @@ export class RbfTimelineTooltipComponent implements OnChanges {
|
|||||||
@Input() rbfInfo: RbfInfo | void;
|
@Input() rbfInfo: RbfInfo | void;
|
||||||
@Input() cursorPosition: { x: number, y: number };
|
@Input() cursorPosition: { x: number, y: number };
|
||||||
|
|
||||||
tooltipPosition = { x: 0, y: 0 };
|
tooltipPosition = null;
|
||||||
|
|
||||||
@ViewChild('tooltip') tooltipElement: ElementRef<HTMLCanvasElement>;
|
@ViewChild('tooltip') tooltipElement: ElementRef<HTMLCanvasElement>;
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ export class RbfTimelineComponent implements OnInit, OnChanges {
|
|||||||
rows: TimelineCell[][] = [];
|
rows: TimelineCell[][] = [];
|
||||||
|
|
||||||
hoverInfo: RbfInfo | void = null;
|
hoverInfo: RbfInfo | void = null;
|
||||||
tooltipPosition = { x: 0, y: 0 };
|
tooltipPosition = null;
|
||||||
|
|
||||||
dir: 'rtl' | 'ltr' = 'ltr';
|
dir: 'rtl' | 'ltr' = 'ltr';
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<tr *ngIf="!replaced">
|
<tr *ngIf="!replaced && !isCached">
|
||||||
<td class="td-width" i18n="transaction.eta|Transaction ETA">ETA</td>
|
<td class="td-width" i18n="transaction.eta|Transaction ETA">ETA</td>
|
||||||
<td>
|
<td>
|
||||||
<ng-template [ngIf]="txInBlockIndex === undefined" [ngIfElse]="estimationTmpl">
|
<ng-template [ngIf]="txInBlockIndex === undefined" [ngIfElse]="estimationTmpl">
|
||||||
|
@ -59,6 +59,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
fetchCpfp$ = new Subject<string>();
|
fetchCpfp$ = new Subject<string>();
|
||||||
fetchRbfHistory$ = new Subject<string>();
|
fetchRbfHistory$ = new Subject<string>();
|
||||||
fetchCachedTx$ = new Subject<string>();
|
fetchCachedTx$ = new Subject<string>();
|
||||||
|
isCached: boolean = false;
|
||||||
now = new Date().getTime();
|
now = new Date().getTime();
|
||||||
timeAvg$: Observable<number>;
|
timeAvg$: Observable<number>;
|
||||||
liquidUnblinding = new LiquidUnblinding();
|
liquidUnblinding = new LiquidUnblinding();
|
||||||
@ -162,7 +163,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
this.tx.effectiveFeePerVsize = totalFees / (totalWeight / 4);
|
this.tx.effectiveFeePerVsize = totalFees / (totalWeight / 4);
|
||||||
|
|
||||||
if (!this.tx.status.confirmed) {
|
if (!this.tx?.status?.confirmed) {
|
||||||
this.stateService.markBlock$.next({
|
this.stateService.markBlock$.next({
|
||||||
txFeePerVSize: this.tx.effectiveFeePerVsize,
|
txFeePerVSize: this.tx.effectiveFeePerVsize,
|
||||||
});
|
});
|
||||||
@ -200,6 +201,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
if (!this.tx) {
|
if (!this.tx) {
|
||||||
this.tx = tx;
|
this.tx = tx;
|
||||||
|
this.isCached = true;
|
||||||
if (tx.fee === undefined) {
|
if (tx.fee === undefined) {
|
||||||
this.tx.fee = 0;
|
this.tx.fee = 0;
|
||||||
}
|
}
|
||||||
@ -208,16 +210,15 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.error = undefined;
|
this.error = undefined;
|
||||||
this.waitingForTransaction = false;
|
this.waitingForTransaction = false;
|
||||||
this.graphExpanded = false;
|
this.graphExpanded = false;
|
||||||
|
this.transactionTime = 0;
|
||||||
this.setupGraph();
|
this.setupGraph();
|
||||||
|
|
||||||
if (!this.tx?.status?.confirmed) {
|
this.fetchRbfHistory$.next(this.tx.txid);
|
||||||
this.fetchRbfHistory$.next(this.tx.txid);
|
this.txRbfInfoSubscription = this.stateService.txRbfInfo$.subscribe((rbfInfo) => {
|
||||||
this.txRbfInfoSubscription = this.stateService.txRbfInfo$.subscribe((rbfInfo) => {
|
if (this.tx) {
|
||||||
if (this.tx) {
|
this.rbfInfo = rbfInfo;
|
||||||
this.rbfInfo = rbfInfo;
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -258,7 +259,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
of(true),
|
of(true),
|
||||||
this.stateService.connectionState$.pipe(
|
this.stateService.connectionState$.pipe(
|
||||||
filter(
|
filter(
|
||||||
(state) => state === 2 && this.tx && !this.tx.status.confirmed
|
(state) => state === 2 && this.tx && !this.tx.status?.confirmed
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -295,10 +296,12 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
)
|
)
|
||||||
.subscribe((tx: Transaction) => {
|
.subscribe((tx: Transaction) => {
|
||||||
if (!tx) {
|
if (!tx) {
|
||||||
|
this.fetchCachedTx$.next(this.txId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.tx = tx;
|
this.tx = tx;
|
||||||
|
this.isCached = false;
|
||||||
if (tx.fee === undefined) {
|
if (tx.fee === undefined) {
|
||||||
this.tx.fee = 0;
|
this.tx.fee = 0;
|
||||||
}
|
}
|
||||||
@ -311,13 +314,17 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.graphExpanded = false;
|
this.graphExpanded = false;
|
||||||
this.setupGraph();
|
this.setupGraph();
|
||||||
|
|
||||||
if (!tx.status.confirmed && tx.firstSeen) {
|
if (!tx.status?.confirmed) {
|
||||||
this.transactionTime = tx.firstSeen;
|
if (tx.firstSeen) {
|
||||||
|
this.transactionTime = tx.firstSeen;
|
||||||
|
} else {
|
||||||
|
this.transactionTime = 0;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.getTransactionTime();
|
this.getTransactionTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.tx.status.confirmed) {
|
if (this.tx?.status?.confirmed) {
|
||||||
this.stateService.markBlock$.next({
|
this.stateService.markBlock$.next({
|
||||||
blockHeight: tx.status.block_height,
|
blockHeight: tx.status.block_height,
|
||||||
});
|
});
|
||||||
@ -334,10 +341,10 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
} else {
|
} else {
|
||||||
this.fetchCpfp$.next(this.tx.txid);
|
this.fetchCpfp$.next(this.tx.txid);
|
||||||
}
|
}
|
||||||
this.fetchRbfHistory$.next(this.tx.txid);
|
|
||||||
}
|
}
|
||||||
|
this.fetchRbfHistory$.next(this.tx.txid);
|
||||||
|
|
||||||
this.priceService.getBlockPrice$(tx.status.block_time, true).pipe(
|
this.priceService.getBlockPrice$(tx.status?.block_time, true).pipe(
|
||||||
tap((price) => {
|
tap((price) => {
|
||||||
this.blockConversion = price;
|
this.blockConversion = price;
|
||||||
})
|
})
|
||||||
@ -371,11 +378,13 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.error = new Error();
|
this.error = new Error();
|
||||||
this.waitingForTransaction = false;
|
this.waitingForTransaction = false;
|
||||||
}
|
}
|
||||||
this.rbfTransaction = rbfTransaction;
|
if (!this.tx?.status?.confirmed) {
|
||||||
this.cacheService.setTxCache([this.rbfTransaction]);
|
this.rbfTransaction = rbfTransaction;
|
||||||
this.replaced = true;
|
this.cacheService.setTxCache([this.rbfTransaction]);
|
||||||
if (rbfTransaction && !this.tx) {
|
this.replaced = true;
|
||||||
this.fetchCachedTx$.next(this.txId);
|
if (rbfTransaction && !this.tx) {
|
||||||
|
this.fetchCachedTx$.next(this.txId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ export interface Env {
|
|||||||
MAINNET_BLOCK_AUDIT_START_HEIGHT: number;
|
MAINNET_BLOCK_AUDIT_START_HEIGHT: number;
|
||||||
TESTNET_BLOCK_AUDIT_START_HEIGHT: number;
|
TESTNET_BLOCK_AUDIT_START_HEIGHT: number;
|
||||||
SIGNET_BLOCK_AUDIT_START_HEIGHT: number;
|
SIGNET_BLOCK_AUDIT_START_HEIGHT: number;
|
||||||
|
FULL_RBF_ENABLED: boolean;
|
||||||
HISTORICAL_PRICE: boolean;
|
HISTORICAL_PRICE: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,6 +74,7 @@ const defaultEnv: Env = {
|
|||||||
'MAINNET_BLOCK_AUDIT_START_HEIGHT': 0,
|
'MAINNET_BLOCK_AUDIT_START_HEIGHT': 0,
|
||||||
'TESTNET_BLOCK_AUDIT_START_HEIGHT': 0,
|
'TESTNET_BLOCK_AUDIT_START_HEIGHT': 0,
|
||||||
'SIGNET_BLOCK_AUDIT_START_HEIGHT': 0,
|
'SIGNET_BLOCK_AUDIT_START_HEIGHT': 0,
|
||||||
|
'FULL_RBF_ENABLED': false,
|
||||||
'HISTORICAL_PRICE': true,
|
'HISTORICAL_PRICE': true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user