diff options
| author | Adam Soltys <[email protected]> | 2025-03-07 14:23:28 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-03-07 14:23:28 -0800 |
| commit | a7667374c8a60b96646650c94a858d55cfb53124 (patch) | |
| tree | d50779f8d6e4d1e54142d46ac5b05b220b1428b2 /lib | |
| parent | ed4374f335bde14fa8e7da90dbce8335338ff72d (diff) | |
| download | coinos-server-a7667374c8a60b96646650c94a858d55cfb53124.tar.gz coinos-server-a7667374c8a60b96646650c94a858d55cfb53124.zip | |
nwc date comparison in seconds
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/nwc.ts | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -361,14 +361,15 @@ const handle = (method, params, ev, app, user) => let transactions = []; for (const pid of payments) { const p = await g(`payment:${pid}`); - if (p.created < from || p.created > until) continue; + const created_at = Math.floor(p.created / 1000); + if (created_at < from || created_at > until) continue; if (p.amount < 0 && type === "incoming") continue; if (p.amount > 0 && type === "outgoing") continue; let payment_hash = p.payment_hash || pid; if (p.type === "lightning") { try { - if(p.amount > 0) { + if (p.amount > 0) { const { invoices } = await ln.listinvoices({ invstring: p.hash }); payment_hash ||= invoices[0].payment_hash; } else { @@ -378,8 +379,6 @@ const handle = (method, params, ev, app, user) => } catch (e) {} } - const created_at = Math.floor(p.created / 1000); - transactions.push({ type: p.amount > 0 ? "incoming" : "outgoing", invoice: p.hash, |
