Hide acceleration panel if tx is already accelerated

This commit is contained in:
Mononaut
2024-04-10 11:12:44 +00:00
parent 0660296b51
commit 940003552b
2 changed files with 7 additions and 3 deletions

View File

@@ -669,6 +669,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
this.hasEffectiveFeeRate = false;
return;
}
const firstCpfp = this.cpfpInfo == null;
// merge ancestors/descendants
const relatives = [...(cpfpInfo.ancestors || []), ...(cpfpInfo.descendants || [])];
if (cpfpInfo.bestDescendant && !cpfpInfo.descendants?.length) {
@@ -688,7 +689,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
}
if (cpfpInfo.acceleration) {
this.tx.acceleration = cpfpInfo.acceleration;
this.setIsAccelerated();
this.setIsAccelerated(firstCpfp);
}
this.cpfpInfo = cpfpInfo;
@@ -700,8 +701,11 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
this.hasEffectiveFeeRate = hasRelatives || (this.tx.effectiveFeePerVsize && (Math.abs(this.tx.effectiveFeePerVsize - this.tx.feePerVsize) > 0.01));
}
setIsAccelerated() {
setIsAccelerated(initialState: boolean = false) {
this.isAcceleration = (this.tx.acceleration || (this.accelerationInfo && this.pool && this.accelerationInfo.pools.some(pool => (pool === this.pool.id || pool?.['pool_unique_id'] === this.pool.id))));
if (this.isAcceleration && initialState) {
this.showAccelerationSummary = false;
}
}
setFeatures(): void {