diff options
| -rw-r--r-- | lib/sendInternal.js | 5 | ||||
| -rw-r--r-- | routes/bitcoin/receive.js | 2 | ||||
| -rw-r--r-- | routes/lightning/receive.js | 2 | ||||
| -rw-r--r-- | routes/liquid/receive.js | 1 |
4 files changed, 7 insertions, 3 deletions
diff --git a/lib/sendInternal.js b/lib/sendInternal.js index e8e5e1b6..554dde91 100644 --- a/lib/sendInternal.js +++ b/lib/sendInternal.js @@ -176,6 +176,9 @@ export default async ( if (invoice) { params.invoice_id = invoice.id; + await invoice.increment({ received: amount }, { transaction }); + await invoice.reload({ transaction }); + let c = store.convert[invoice.text]; if (c) { l( @@ -200,6 +203,8 @@ export default async ( p2 = p2.get({ plain: true }); p2.account = a2.get({ plain: true }); + if (invoice) p2.invoice = invoice.get({ plain: true }); + emit(recipient.username, "payment", p2); emit(recipient.username, "account", p2.account); diff --git a/routes/bitcoin/receive.js b/routes/bitcoin/receive.js index eb1c7868..714aa3b2 100644 --- a/routes/bitcoin/receive.js +++ b/routes/bitcoin/receive.js @@ -144,9 +144,9 @@ zmqRawTx.on("message", async (topic, message, sequence) => { payment = payment.get({ plain: true }); payment.account = account.get({ plain: true }); + payment.invoice = invoice.get({ plain: true }); emit(user.username, "account", account); - emit(user.username, "payment", payment); l("bitcoin detected", user.username, value); notify(user, `${value} SAT payment detected`); diff --git a/routes/lightning/receive.js b/routes/lightning/receive.js index 2ca6f960..97c4b47f 100644 --- a/routes/lightning/receive.js +++ b/routes/lightning/receive.js @@ -92,8 +92,6 @@ const handlePayment = async msg => { callWebhook(invoice, payment); - console.log("INVOICE", payment.invoice.received); - emit(user.username, "payment", payment); emit(user.username, "account", payment.account); notify(user, `Received ${total} SAT`); diff --git a/routes/liquid/receive.js b/routes/liquid/receive.js index 2cd0e957..a8d73718 100644 --- a/routes/liquid/receive.js +++ b/routes/liquid/receive.js @@ -202,6 +202,7 @@ zmqRawTx.on("message", async (topic, message, sequence) => { payment = payment.get({ plain: true }); payment.account = account.get({ plain: true }); + payment.invoice = invoice.get({ plain: true }); emit(user.username, "payment", payment); emit(user.username, "account", payment.account); |
