aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/payments.ts4
-rw-r--r--routes/payments.ts4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/payments.ts b/lib/payments.ts
index 2a2176e6..b3581847 100644
--- a/lib/payments.ts
+++ b/lib/payments.ts
@@ -119,7 +119,7 @@ export const debit = async ({
? Math.round((amount + fee + tip) * config.fee[creditType])
: 0;
- if (aid) ourfee = 0;
+ if (aid && aid !== uid) ourfee = 0;
ourfee = await db.debit(
`balance:${aid || uid}`,
@@ -696,7 +696,7 @@ export const build = async ({
const covered = Math.min(credit, ourfee);
ourfee -= covered;
- if (aid) ourfee = 0;
+ if (aid && aid !== user.id) ourfee = 0;
if (subtract || amount + fee + ourfee > balance) {
if (amount <= fee + ourfee + dust)
fail(
diff --git a/routes/payments.ts b/routes/payments.ts
index 71f29da4..56e0b9d3 100644
--- a/routes/payments.ts
+++ b/routes/payments.ts
@@ -2,6 +2,7 @@ import config from "$config";
import api from "$lib/api";
import { requirePin } from "$lib/auth";
import { db, g, s } from "$lib/db";
+import ln from "$lib/ln";
import { err, l, warn } from "$lib/logging";
import mqtt from "$lib/mqtt";
import {
@@ -15,6 +16,7 @@ import {
sendOnchain,
} from "$lib/payments";
import { emit } from "$lib/sockets";
+import { PaymentType } from "$lib/types";
import {
SATS,
bail,
@@ -28,8 +30,6 @@ import {
import rpc from "@coinos/rpc";
import got from "got";
import { v4 } from "uuid";
-import { PaymentType } from "$lib/types";
-import ln from "$lib/ln";
export default {
async info(_, res) {