aboutsummaryrefslogtreecommitdiffstats
path: root/routes/lightning
diff options
context:
space:
mode:
Diffstat (limited to 'routes/lightning')
-rw-r--r--routes/lightning/receive.js6
1 files changed, 4 insertions, 2 deletions
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",