mirror of
https://github.com/mempool/mempool.git
synced 2025-02-25 15:10:12 +01:00
Bugfix: Ancestors are not able to increase fee of descendants
fixes #426
This commit is contained in:
parent
5914d99283
commit
56b0eab9b4
1 changed files with 3 additions and 2 deletions
|
@ -109,8 +109,9 @@ export class TransactionComponent implements OnInit, OnDestroy {
|
||||||
} else {
|
} else {
|
||||||
this.apiService.getCpfpinfo$(this.tx.txid)
|
this.apiService.getCpfpinfo$(this.tx.txid)
|
||||||
.subscribe((cpfpInfo) => {
|
.subscribe((cpfpInfo) => {
|
||||||
let totalWeight = tx.weight + cpfpInfo.ancestors.reduce((prev, val) => prev + val.weight, 0);
|
const lowerFeeParents = cpfpInfo.ancestors.filter((ancestor) => (ancestor.fee / (ancestor.weight / 4)) < tx.feePerVsize);
|
||||||
let totalFees = tx.fee + cpfpInfo.ancestors.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);
|
||||||
|
|
||||||
if (cpfpInfo.bestDescendant) {
|
if (cpfpInfo.bestDescendant) {
|
||||||
totalWeight += cpfpInfo.bestDescendant.weight;
|
totalWeight += cpfpInfo.bestDescendant.weight;
|
||||||
|
|
Loading…
Add table
Reference in a new issue