aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sync.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-09-09 10:27:32 -0400
committerAdam Soltys <[email protected]>2022-09-09 07:28:02 -0700
commitd2ae5acf545c8b1a4f88f87b8d80b20c9d45245d (patch)
tree153f3bb2b230de1a71927dd7535b5d48833fcaa8 /lib/sync.js
parent97779d3ca57785fa07dc15fd1860f26d17fac818 (diff)
downloadcoinos-server-d2ae5acf545c8b1a4f88f87b8d80b20c9d45245d.tar.gz
coinos-server-d2ae5acf545c8b1a4f88f87b8d80b20c9d45245d.zip
use actual received amount for lightning payments
Diffstat (limited to 'lib/sync.js')
-rw-r--r--lib/sync.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/sync.js b/lib/sync.js
index 7b72b20a..536bd582 100644
--- a/lib/sync.js
+++ b/lib/sync.js
@@ -80,14 +80,14 @@ const sync = async () => {
let recent = invoices
.filter(
i =>
- i.settled &&
- differenceInDays(new Date(), new Date(i.settle_date * 1000)) < 2
+ i.secret &&
+ differenceInDays(new Date(), new Date(i.created_at)) < 2
)
.map(i => ({
- amount: parseInt(i.amt_paid_sat),
- preimage: i.r_preimage.toString("hex"),
- pr: i.payment_request.toString("hex"),
- createdAt: new Date(i.settle_date * 1000)
+ amount: parseInt(i.received),
+ preimage: i.secret,
+ pr: i.request.toString("hex"),
+ createdAt: new Date(i.created_at)
}));
const twoDaysAgo = new Date(new Date().setDate(new Date().getDate() - 2));