From 79e494150c19f6f30ce5cf23ef2baa0d1a67945e Mon Sep 17 00:00:00 2001 From: Mononaut Date: Fri, 9 Aug 2024 14:44:51 +0000 Subject: [PATCH 1/4] fix mined acceleration detection logic on tx pages --- frontend/src/app/components/tracker/tracker.component.ts | 2 +- .../src/app/components/transaction/transaction.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/tracker/tracker.component.ts b/frontend/src/app/components/tracker/tracker.component.ts index c869f9705..24b5fc1dc 100644 --- a/frontend/src/app/components/tracker/tracker.component.ts +++ b/frontend/src/app/components/tracker/tracker.component.ts @@ -293,7 +293,7 @@ export class TrackerComponent implements OnInit, OnDestroy { }) ).subscribe((accelerationHistory) => { for (const acceleration of accelerationHistory) { - if (acceleration.txid === this.txId && (acceleration.status === 'completed' || acceleration.status === 'completed_provisional')) { + if (acceleration.txid === this.txId && (acceleration.status === 'completed' || acceleration.status === 'completed_provisional') && acceleration.pools.includes(acceleration.minedByPoolUniqueId)) { const boostCost = acceleration.boostCost || acceleration.bidBoost; acceleration.acceleratedFeeRate = Math.max(acceleration.effectiveFee, acceleration.effectiveFee + boostCost) / acceleration.effectiveVsize; acceleration.boost = boostCost; diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts index bcad164cc..01bbcb6f4 100644 --- a/frontend/src/app/components/transaction/transaction.component.ts +++ b/frontend/src/app/components/transaction/transaction.component.ts @@ -358,7 +358,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { }), ).subscribe((accelerationHistory) => { for (const acceleration of accelerationHistory) { - if (acceleration.txid === this.txId && (acceleration.status === 'completed' || acceleration.status === 'completed_provisional')) { + if (acceleration.txid === this.txId && (acceleration.status === 'completed' || acceleration.status === 'completed_provisional') && acceleration.pools.includes(acceleration.minedByPoolUniqueId)) { const boostCost = acceleration.boostCost || acceleration.bidBoost; acceleration.acceleratedFeeRate = Math.max(acceleration.effectiveFee, acceleration.effectiveFee + boostCost) / acceleration.effectiveVsize; acceleration.boost = boostCost; From a31729b8b8ffaf611cd2274954d7abd2cc419e79 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Sat, 10 Aug 2024 21:56:11 +0000 Subject: [PATCH 2/4] fix feeDelta display logic --- .../transaction/transaction.component.html | 19 +++++++++---------- .../transaction/transaction.component.ts | 14 ++++++++------ 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index ecd00e599..2ae6c8df8 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -606,16 +606,15 @@ @if (!isLoadingTx) { Fee - {{ tx.fee | number }} sat - @if (accelerationInfo?.bidBoost) { - +{{ accelerationInfo.bidBoost | number }} sat - - } @else if (tx.feeDelta && !accelerationInfo) { - +{{ tx.feeDelta | number }} sat - - } @else { - - } + {{ tx.fee | number }} sat + + @if (accelerationInfo?.bidBoost) { + +{{ accelerationInfo.bidBoost | number }} sat + } @else if (tx.feeDelta) { + +{{ tx.feeDelta | number }} sat + } + + } @else { diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts index 01bbcb6f4..637aa52e3 100644 --- a/frontend/src/app/components/transaction/transaction.component.ts +++ b/frontend/src/app/components/transaction/transaction.component.ts @@ -358,12 +358,14 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { }), ).subscribe((accelerationHistory) => { for (const acceleration of accelerationHistory) { - if (acceleration.txid === this.txId && (acceleration.status === 'completed' || acceleration.status === 'completed_provisional') && acceleration.pools.includes(acceleration.minedByPoolUniqueId)) { - const boostCost = acceleration.boostCost || acceleration.bidBoost; - acceleration.acceleratedFeeRate = Math.max(acceleration.effectiveFee, acceleration.effectiveFee + boostCost) / acceleration.effectiveVsize; - acceleration.boost = boostCost; - this.tx.acceleratedAt = acceleration.added; - this.accelerationInfo = acceleration; + if (acceleration.txid === this.txId) { + if ((acceleration.status === 'completed' || acceleration.status === 'completed_provisional') && acceleration.pools.includes(acceleration.minedByPoolUniqueId)) { + const boostCost = acceleration.boostCost || acceleration.bidBoost; + acceleration.acceleratedFeeRate = Math.max(acceleration.effectiveFee, acceleration.effectiveFee + boostCost) / acceleration.effectiveVsize; + acceleration.boost = boostCost; + this.tx.acceleratedAt = acceleration.added; + this.accelerationInfo = acceleration; + } this.waitingForAccelerationInfo = false; this.setIsAccelerated(); } From b3ac107b0b5bd31ebe1f0957a8730f7081229bdf Mon Sep 17 00:00:00 2001 From: natsoni Date: Sun, 18 Aug 2024 18:33:25 +0200 Subject: [PATCH 3/4] clear feeDelta if a tx is mined by non-participating pool --- .../transaction/transaction.component.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts index 637aa52e3..8c0d3b4a9 100644 --- a/frontend/src/app/components/transaction/transaction.component.ts +++ b/frontend/src/app/components/transaction/transaction.component.ts @@ -359,12 +359,16 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { ).subscribe((accelerationHistory) => { for (const acceleration of accelerationHistory) { if (acceleration.txid === this.txId) { - if ((acceleration.status === 'completed' || acceleration.status === 'completed_provisional') && acceleration.pools.includes(acceleration.minedByPoolUniqueId)) { - const boostCost = acceleration.boostCost || acceleration.bidBoost; - acceleration.acceleratedFeeRate = Math.max(acceleration.effectiveFee, acceleration.effectiveFee + boostCost) / acceleration.effectiveVsize; - acceleration.boost = boostCost; - this.tx.acceleratedAt = acceleration.added; - this.accelerationInfo = acceleration; + if (acceleration.status === 'completed' || acceleration.status === 'completed_provisional') { + if (acceleration.pools.includes(acceleration.minedByPoolUniqueId)) { + const boostCost = acceleration.boostCost || acceleration.bidBoost; + acceleration.acceleratedFeeRate = Math.max(acceleration.effectiveFee, acceleration.effectiveFee + boostCost) / acceleration.effectiveVsize; + acceleration.boost = boostCost; + this.tx.acceleratedAt = acceleration.added; + this.accelerationInfo = acceleration; + } else { + this.tx.feeDelta = undefined; + } } this.waitingForAccelerationInfo = false; this.setIsAccelerated(); From f75f85f914e75d20fd978472a12593fe360d5924 Mon Sep 17 00:00:00 2001 From: natsoni Date: Sun, 18 Aug 2024 19:43:38 +0200 Subject: [PATCH 4/4] Hide fee delta on accelerated tx mined by participating pool with 0 bid boost --- .../transaction/transaction.component.html | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index 2ae6c8df8..715fca4c8 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -607,14 +607,10 @@ Fee {{ tx.fee | number }} sat - - @if (accelerationInfo?.bidBoost) { - +{{ accelerationInfo.bidBoost | number }} sat - } @else if (tx.feeDelta) { - +{{ tx.feeDelta | number }} sat - } - - + @if (accelerationInfo?.bidBoost ?? tx.feeDelta > 0) { + +{{ accelerationInfo?.bidBoost ?? tx.feeDelta | number }} sat + } + } @else {