Merge pull request #419 from mempool/simon/cpfp-duplicate-fix
Fix for duplicate cpfp ancestors.
This commit is contained in:
		
						commit
						0f9f905fd1
					
				@ -114,6 +114,10 @@ export class Common {
 | 
				
			|||||||
  private static findAllParents(tx: TransactionExtended, memPool: { [txid: string]: TransactionExtended }): TransactionExtended[] {
 | 
					  private static findAllParents(tx: TransactionExtended, memPool: { [txid: string]: TransactionExtended }): TransactionExtended[] {
 | 
				
			||||||
    let parents: TransactionExtended[] = [];
 | 
					    let parents: TransactionExtended[] = [];
 | 
				
			||||||
    tx.vin.forEach((parent) => {
 | 
					    tx.vin.forEach((parent) => {
 | 
				
			||||||
 | 
					      if (parents.find((p) => p.txid === parent.txid)) {
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      const parentTx = memPool[parent.txid];
 | 
					      const parentTx = memPool[parent.txid];
 | 
				
			||||||
      if (parentTx) {
 | 
					      if (parentTx) {
 | 
				
			||||||
        if (tx.bestDescendant && tx.bestDescendant.fee / (tx.bestDescendant.weight / 4) > parentTx.feePerVsize) {
 | 
					        if (tx.bestDescendant && tx.bestDescendant.fee / (tx.bestDescendant.weight / 4) > parentTx.feePerVsize) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user