Hide features row if tx has no features

This commit is contained in:
Mononaut
2023-03-13 12:48:01 +09:00
parent f4f8b2b271
commit 130ae8c3a5
4 changed files with 35 additions and 4 deletions

View File

@@ -21,12 +21,19 @@ export class TxFeaturesComponent implements OnChanges {
isRbfTransaction: boolean;
isTaproot: boolean;
segwitEnabled: boolean;
rbfEnabled: boolean;
taprootEnabled: boolean;
constructor() { }
ngOnChanges() {
if (!this.tx) {
return;
}
this.segwitEnabled = !this.tx.status.confirmed || this.tx.status.block_height >= 477120;
this.taprootEnabled = !this.tx.status.confirmed || this.tx.status.block_height >= 709632;
this.rbfEnabled = !this.tx.status.confirmed || this.tx.status.block_height > 399700;
this.segwitGains = calcSegwitFeeGains(this.tx);
this.isRbfTransaction = this.tx.vin.some((v) => v.sequence < 0xfffffffe);
this.isTaproot = this.tx.vin.some((v) => v.prevout && v.prevout.scriptpubkey_type === 'v1_p2tr');