From 517a37728c3d420530afb91adb7f0a4a7090ac2f Mon Sep 17 00:00:00 2001 From: Mononaut Date: Sat, 28 Sep 2024 16:34:13 +0000 Subject: [PATCH] Don't clobber effective fee rates --- backend/src/api/transaction-utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/api/transaction-utils.ts b/backend/src/api/transaction-utils.ts index 15d3e7110..28fa72bba 100644 --- a/backend/src/api/transaction-utils.ts +++ b/backend/src/api/transaction-utils.ts @@ -121,6 +121,7 @@ class TransactionUtils { const adjustedVsize = Math.max(fractionalVsize, sigops * 5); // adjusted vsize = Max(weight, sigops * bytes_per_sigop) / witness_scale_factor const feePerVbytes = (transaction.fee || 0) / fractionalVsize; const adjustedFeePerVsize = (transaction.fee || 0) / adjustedVsize; + const effectiveFeePerVsize = transaction['effectiveFeePerVsize'] || adjustedFeePerVsize || feePerVbytes; const transactionExtended: MempoolTransactionExtended = Object.assign(transaction, { order: this.txidToOrdering(transaction.txid), vsize, @@ -128,7 +129,7 @@ class TransactionUtils { sigops, feePerVsize: feePerVbytes, adjustedFeePerVsize: adjustedFeePerVsize, - effectiveFeePerVsize: adjustedFeePerVsize, + effectiveFeePerVsize: effectiveFeePerVsize, }); if (!transactionExtended?.status?.confirmed && !transactionExtended.firstSeen) { transactionExtended.firstSeen = Math.round((Date.now() / 1000));