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/liquid | |
| parent | dcb21adb40a44c8108f1d652cc6ddd59ae7c4024 (diff) | |
| download | coinos-server-74b7d2a0d614f170ba5aea3a1a172a7a68356d80.tar.gz coinos-server-74b7d2a0d614f170ba5aea3a1a172a7a68356d80.zip | |
push notifications
Diffstat (limited to 'routes/liquid')
| -rw-r--r-- | routes/liquid/receive.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/routes/liquid/receive.js b/routes/liquid/receive.js index b3f82a2d..9a97aa47 100644 --- a/routes/liquid/receive.js +++ b/routes/liquid/receive.js @@ -121,6 +121,7 @@ zmqRawTx.on("message", async (topic, message, sequence) => { emit(user.username, "payment", payment); l.info("liquid detected", user.username, asset, value); + notify(user, `${value} SAT payment detected`); } }) ); @@ -231,9 +232,10 @@ setInterval(async () => { const { user } = p; if (p) { + let total = p.amount + p.tip; p.confirmed = 1; - p.account.balance += p.amount + p.tip; - p.account.pending -= Math.min(p.account.pending, p.amount + p.tip); + p.account.balance += total; + p.account.pending -= Math.min(p.account.pending, total); await p.account.save(); await p.save(); @@ -247,6 +249,8 @@ setInterval(async () => { p.amount, p.tip ); + + notify(user, `${total} SAT payment confirmed`); } else { l.warn("couldn't find payment", hash); } |
