From b83e7189e66c4d4f04a029268e87af185bf7aee7 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 9 Sep 2022 14:27:28 -0400 Subject: remove cancelled fix --- lib/sync.js | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'lib') diff --git a/lib/sync.js b/lib/sync.js index 57f0c507..62d13b24 100644 --- a/lib/sync.js +++ b/lib/sync.js @@ -100,28 +100,6 @@ const sync = async () => { }) ).map(p => p.preimage); - for (let i = 0; i < cancelled.length; i++) { - let c = cancelled[i]; - if (settled.includes(c.secret)) { - await db.transaction(async transaction => { - let p = await db.Payment.findOne({ - where: { - preimage: c.secret - }, - include: { - model: db.Account, - as: "account" - }, - transaction - }); - - console.log("destroying", p.id); - await p.account.decrement({ balance: p.amount }, { transaction }); - await p.destroy({ transaction }); - }); - } - } - let missed = recent.filter(i => !settled.includes(i.preimage)); for (let i = 0; i < missed.length; i++) { let { amount, preimage, pr: text, createdAt } = missed[i]; -- cgit v1.2.3