Fix for duplicate cpfp ancestors.

fixes #414
This commit is contained in:
softsimon 2021-04-02 00:30:51 +04:00
parent f5d55c8e09
commit e2845bf97b

View File

@ -113,6 +113,10 @@ export class Common {
private static findAllParents(tx: TransactionExtended, memPool: { [txid: string]: TransactionExtended }): TransactionExtended[] {
let parents: TransactionExtended[] = [];
tx.vin.forEach((parent) => {
if (parents.find((p) => p.txid === parent.txid)) {
return;
}
const parentTx = memPool[parent.txid];
if (parentTx) {
if (tx.bestDescendant && tx.bestDescendant.fee / (tx.bestDescendant.weight / 4) > parentTx.feePerVsize) {