diff options
| author | Adam Soltys <[email protected]> | 2020-06-13 21:39:22 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-06-13 21:39:22 -0700 |
| commit | 74b7d2a0d614f170ba5aea3a1a172a7a68356d80 (patch) | |
| tree | be2a73a9917616c0b49c24dc99642378e5a47549 /routes/lightning | |
| parent | dcb21adb40a44c8108f1d652cc6ddd59ae7c4024 (diff) | |
| download | coinos-server-74b7d2a0d614f170ba5aea3a1a172a7a68356d80.tar.gz coinos-server-74b7d2a0d614f170ba5aea3a1a172a7a68356d80.zip | |
push notifications
Diffstat (limited to 'routes/lightning')
| -rw-r--r-- | routes/lightning/receive.js | 6 |
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", |
