aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sync.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-09-13 10:10:10 -0700
committerAdam Soltys <[email protected]>2022-09-13 10:10:10 -0700
commit1752bb585d3cc00c7bd57dee9ba7b84d945d79de (patch)
treef68cbfe5741b96c17ad9c8818656b6ed7f581876 /lib/sync.js
parent75c2cd0391158aeaf9d0f9b4f0e56edc825bf667 (diff)
parentf62d5b5c6233510576df0e934d422395b9957833 (diff)
downloadcoinos-server-1752bb585d3cc00c7bd57dee9ba7b84d945d79de.tar.gz
coinos-server-1752bb585d3cc00c7bd57dee9ba7b84d945d79de.zip
Merge branch 'prod'
Diffstat (limited to 'lib/sync.js')
-rw-r--r--lib/sync.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/sync.js b/lib/sync.js
index 62d13b24..467ce107 100644
--- a/lib/sync.js
+++ b/lib/sync.js
@@ -76,8 +76,6 @@ const sync = async () => {
});
let { invoices } = await getInvoices({ lnd, limit: 1000 });
- let x = invoices.find(i => i.request.includes('lnbc10100u1p333l3lpp5znwsrpr9g'));
- let cancelled = invoices.filter(i => i.is_canceled);
let recent = invoices
.filter(
@@ -88,7 +86,7 @@ const sync = async () => {
.map(i => ({
amount: parseInt(i.received),
preimage: i.secret,
- pr: i.request.toString("hex"),
+ pr: i.request,
createdAt: new Date(i.created_at)
}));
@@ -103,7 +101,7 @@ const sync = async () => {
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];
- if (!text.length) continue;
+ if (!text || !text.length) continue;
try {
let invoice = await db.Invoice.findOne({