Bugfix: Ancestors are not able to increase fee of descendants
fixes #426
This commit is contained in:
		
							parent
							
								
									2b1c511611
								
							
						
					
					
						commit
						5914d99283
					
				@ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user