From 988ac805d0a11453edec64af05dbc4c32301035d Mon Sep 17 00:00:00 2001 From: Overtorment Date: Tue, 1 Sep 2020 16:01:26 +0100 Subject: [PATCH] FIX: pass fixed (promised in bolt11) sat amount to groundcontrol instead of delivered by HTLC (closes #99) --- controllers/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/api.js b/controllers/api.js index 9cc2527..2c59a58 100644 --- a/controllers/api.js +++ b/controllers/api.js @@ -60,7 +60,7 @@ const subscribeInvoicesCallCallback = async function (response) { memo: response.memo, preimage: response.r_preimage.toString('hex'), hash: response.r_hash.toString('hex'), - amt_paid_sat: response.amt_paid_sat, + amt_paid_sat: response.value_msat ? Math.floor(response.value_msat / 1000) : response.value, }; // obtaining a lock, to make sure we push to groundcontrol only once // since this web server can have several instances running, and each will get the same callback from LND