Bugfix: Ancestors are not able to increase fee of descendants

fixes #426
This commit is contained in:
softsimon committed 2021-04-05 23:45:47 +04:00
1 parent f5d55c8e09
commit f9256704ab
2 files changed
+4 -6

No files matched your search

+3 -2
View File
@@ -81,9 +81,10 @@ export class Common {
static setRelativesAndGetCpfpInfo(tx: TransactionExtended, memPool: { [txid: string]: TransactionExtended }): CpfpInfo {
const parents = this.findAllParents(tx, memPool);
const lowerFeeParents = parents.filter((parent) => parent.feePerVsize < tx.feePerVsize);
let totalWeight = tx.weight + parents.reduce((prev, val) => prev + val.weight, 0);
let totalFees = tx.fee + parents.reduce((prev, val) => prev + val.fee, 0);
let totalWeight = tx.weight + lowerFeeParents.reduce((prev, val) => prev + val.weight, 0);
let totalFees = tx.fee + lowerFeeParents.reduce((prev, val) => prev + val.fee, 0);
tx.ancestors = parents
.map((t) => {