Add Taproot transaction feature tooltip with fee saving information

This commit is contained in:
Antoni Spaanderman
2022-07-24 00:08:53 +02:00
parent 300b9e4e05
commit eb9c6f2231
4 changed files with 122 additions and 60 deletions

View File

@@ -12,12 +12,13 @@ export class TxFeaturesComponent implements OnChanges {
@Input() tx: Transaction;
segwitGains = {
realizedGains: 0,
realizedBech32Gains: 0,
potentialBech32Gains: 0,
potentialP2shGains: 0,
potentialTaprootGains: 0,
realizedTaprootGains: 0
};
isRbfTransaction: boolean;
isTaproot: boolean;
constructor() { }
@@ -27,6 +28,5 @@ export class TxFeaturesComponent implements OnChanges {
}
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');
}
}