From 7c1f6e8c79f9f8ef8923328012aa3910fdd455a6 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 27 Jun 2020 14:53:49 -0700 Subject: watch old invoice addresses --- routes/payments.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/routes/payments.js b/routes/payments.js index 9fa2ce54..f82262df 100644 --- a/routes/payments.js +++ b/routes/payments.js @@ -15,6 +15,14 @@ const { join } = require("path"); if (u.liquid) addresses[u.liquid] = u.username; }); + await db.Invoice.findAll({ + include: [{ + model: db.User, + as: 'user'}] + }).map(i => { + if (i.address && i.user) addresses[i.address] = i.user.username; + }); + payments = ( await db.Payment.findAll({ attributes: ["hash"] -- cgit v1.2.3