mirror of
https://github.com/mempool/mempool.git
synced 2025-03-03 17:47:01 +01:00
Bugfix: Ancestors are not able to increase fee of descendants
fixes #426
This commit is contained in:
parent
2b1c511611
commit
5914d99283
2 changed files with 4 additions and 6 deletions
|
@ -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) => {
|
||||
|
|
|
@ -177,10 +177,7 @@
|
|||
</td>
|
||||
<td class="d-none d-lg-table-cell">{{ cpfpTx.weight / 4 | vbytes: 2 }}</td>
|
||||
<td>{{ roundToOneDecimal(cpfpTx) | number : '1.1-1' }} <span i18n="shared.sat-vbyte|sat/vB">sat/vB</span></td>
|
||||
<td class="d-none d-lg-table-cell"><fa-icon *ngIf="roundToOneDecimal(cpfpTx) > tx.feePerVsize; else arrowDown" class="arrow-green" [icon]="['fas', 'angle-double-up']" [fixedWidth]="true"></fa-icon></td>
|
||||
<ng-template #arrowDown>
|
||||
<fa-icon *ngIf="roundToOneDecimal(cpfpTx) !== tx.feePerVsize" class="arrow-red" [icon]="['fas', 'angle-double-down']" [fixedWidth]="true"></fa-icon>
|
||||
</ng-template>
|
||||
<td class="d-none d-lg-table-cell"><fa-icon *ngIf="roundToOneDecimal(cpfpTx) < tx.feePerVsize" class="arrow-red" [icon]="['fas', 'angle-double-down']" [fixedWidth]="true"></fa-icon></td>
|
||||
</tr>
|
||||
</ng-template>
|
||||
</tbody>
|
||||
|
|
Loading…
Add table
Reference in a new issue