Effective fee could go below 0 due to rounding error. (#623)

fixes #606
This commit is contained in:
softsimon 2021-07-14 22:42:48 +03:00 committed by GitHub
parent d13e18a72a
commit ecbd18087b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {