aboutsummaryrefslogtreecommitdiffstats
path: root/routes/liquid
diff options
context:
space:
mode:
Diffstat (limited to 'routes/liquid')
-rw-r--r--routes/liquid/receive.js8
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);
}