Merge pull request #4935 from mempool/mononaut/acc-rate-tooltips
Fix accelerated fee rate in mined block tooltips
This commit is contained in:
		
						commit
						be75a87e88
					
				@ -68,7 +68,7 @@ export class BlockOverviewTooltipComponent implements OnChanges {
 | 
			
		||||
      this.effectiveRate = this.tx.rate;
 | 
			
		||||
      const txFlags = BigInt(this.tx.flags) || 0n;
 | 
			
		||||
      this.acceleration = this.tx.acc || (txFlags & TransactionFlags.acceleration);
 | 
			
		||||
      this.hasEffectiveRate = Math.abs((this.fee / this.vsize) - this.effectiveRate) > 0.05
 | 
			
		||||
      this.hasEffectiveRate = this.tx.acc || Math.abs((this.fee / this.vsize) - this.effectiveRate) > 0.05
 | 
			
		||||
        || (txFlags && (txFlags & (TransactionFlags.cpfp_child | TransactionFlags.cpfp_parent)) > 0n);
 | 
			
		||||
      this.filters = this.tx.flags ? toFilters(txFlags).filter(f => f.tooltip) : [];
 | 
			
		||||
      this.activeFilters = {}
 | 
			
		||||
 | 
			
		||||
@ -365,6 +365,12 @@ export class BlockComponent implements OnInit, OnDestroy {
 | 
			
		||||
      for (const tx of transactions) {
 | 
			
		||||
        if (acceleratedInBlock[tx.txid]) {
 | 
			
		||||
          tx.acc = true;
 | 
			
		||||
          const acceleration = acceleratedInBlock[tx.txid];
 | 
			
		||||
          const boostCost = acceleration.boostCost || (acceleration.feePaid - acceleration.baseFee - acceleration.vsizeFee);
 | 
			
		||||
          const acceleratedFeeRate = Math.max(acceleration.effectiveFee, acceleration.effectiveFee + boostCost) / acceleration.effectiveVsize;
 | 
			
		||||
          if (acceleratedFeeRate > tx.rate) {
 | 
			
		||||
            tx.rate = acceleratedFeeRate;
 | 
			
		||||
          }
 | 
			
		||||
        } else {
 | 
			
		||||
          tx.acc = false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user