From 74b7d2a0d614f170ba5aea3a1a172a7a68356d80 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 13 Jun 2020 21:39:22 -0700 Subject: push notifications --- routes/lightning/receive.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'routes/lightning') diff --git a/routes/lightning/receive.js b/routes/lightning/receive.js index 6a9c95c8..292f19e2 100644 --- a/routes/lightning/receive.js +++ b/routes/lightning/receive.js @@ -48,8 +48,9 @@ const handlePayment = async msg => { }, { transaction }); - invoice.received += amount + tip; - account.balance += amount + tip; + let total = amount + tip; + invoice.received += total; + account.balance += total; await account.save({ transaction }); await invoice.save({ transaction }); @@ -60,6 +61,7 @@ const handlePayment = async msg => { payment.account = account.get({ plain: true }); emit(user.username, "payment", payment); emit(user.username, "account", payment.account); + notify(user, `Received ${total} SAT`); l.info( "lightning payment received", -- cgit v1.2.3