Fix for duplicate cpfp ancestors.

fixes #414
This commit is contained in:
softsimon committed 2021-04-02 00:30:51 +04:00
1 parent 2b1c511611
commit 4d0429b786
1 file changed
+4
+4
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) {