aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-05-25 23:35:57 -0700
committerAdam Soltys <[email protected]>2023-05-25 23:35:57 -0700
commit3cb02fa61df056da7f7dd2312c538381150bd763 (patch)
tree66258b3b4f7b9510169bc5988bab7842ddce6591
parent07520c066d48bbfe32c3de640d09bd9400417992 (diff)
downloadcoinos-server-3cb02fa61df056da7f7dd2312c538381150bd763.tar.gz
coinos-server-3cb02fa61df056da7f7dd2312c538381150bd763.zip
fix amount received
-rw-r--r--lib/lightning.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/lightning.js b/lib/lightning.js
index 7ef62cc9..a44e0da8 100644
--- a/lib/lightning.js
+++ b/lib/lightning.js
@@ -9,19 +9,20 @@ import { credit, types } from "$lib/payments";
export async function listenForLightning() {
let event = await ln.waitanyinvoice(await g("pay_index"));
+ console.log("EVENT", event);
let {
payment_hash: hash,
bolt11,
pay_index,
status,
- msatoshi_received,
+ amount_received_msat,
payment_preimage: preimage
} = event;
await s("pay_index", pay_index);
setTimeout(listenForLightning);
- let received = Math.round(msatoshi_received / 1000);
+ let received = Math.round(amount_received_msat / 1000);
try {
l("incoming lightning payment", received);