aboutsummaryrefslogtreecommitdiffstats
path: root/lib/payments.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/payments.ts')
-rw-r--r--lib/payments.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/payments.ts b/lib/payments.ts
index 8f197044..66e725c7 100644
--- a/lib/payments.ts
+++ b/lib/payments.ts
@@ -12,7 +12,6 @@ import {
fail,
fiat,
getInvoice,
- getUser,
sleep,
SATS,
sats,
@@ -605,14 +604,14 @@ export let sendLightning = async ({
}
};
-export let sendInternal = async ({ amount, recipient, sender }) => {
- let inv = await generate({
+export let sendInternal = async ({ amount, invoice = undefined, recipient, sender }) => {
+ if (!invoice) invoice = await generate({
invoice: { amount, type: "lightning" },
user: recipient,
sender,
});
- let { hash } = inv;
+ let { hash } = invoice;
let memo;
let p = await debit({ hash, amount, memo, user: sender });