From ecbd18087b267ba61b74477c973281b740edaf30 Mon Sep 17 00:00:00 2001 From: softsimon Date: Wed, 14 Jul 2021 22:42:48 +0300 Subject: [PATCH] Effective fee could go below 0 due to rounding error. (#623) fixes #606 --- backend/src/api/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/api/common.ts b/backend/src/api/common.ts index e1021c234..a560bfdfe 100644 --- a/backend/src/api/common.ts +++ b/backend/src/api/common.ts @@ -105,7 +105,7 @@ export class Common { totalFees += tx.bestDescendant.fee; } - tx.effectiveFeePerVsize = totalFees / (totalWeight / 4); + tx.effectiveFeePerVsize = Math.max(1, totalFees / (totalWeight / 4)); tx.cpfpChecked = true; return {