diff options
Diffstat (limited to 'lib/payments.js')
| -rw-r--r-- | lib/payments.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/payments.js b/lib/payments.js index 47cb11f4..6fd595d4 100644 --- a/lib/payments.js +++ b/lib/payments.js @@ -36,8 +36,8 @@ export let debit = async ( if (!amount || amount < 0) fail("Amount must be greater than zero"); let ourfee = [types.bitcoin, types.lightning].includes(type) - ? 0 - : Math.round(amount * config.fee); + ? Math.round(amount * config.fee) + : 0; await t(`balance:${uid}`, async (balance, db) => { await t(`credit:${type}:${uid}`, async (credit, db) => { @@ -85,6 +85,7 @@ export let credit = async (hash, amount, memo, ref, type = types.internal) => { amount = parseInt(amount); let invoice = await g(`invoice:${hash}`); if (!invoice) return; + if (!memo) ({ memo } = invoice); let user = await g(`user:${invoice.uid}`); |
