aboutsummaryrefslogtreecommitdiffstats
path: root/lib/payments.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/payments.js')
-rw-r--r--lib/payments.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/payments.js b/lib/payments.js
index 8806e6f8..2c0eb0c0 100644
--- a/lib/payments.js
+++ b/lib/payments.js
@@ -13,7 +13,7 @@ export const types = {
bitcoin: "bitcoin",
lightning: "lightning",
pot: "pot",
- classic: "classic"
+ classic: "classic",
};
export let debit = async (
@@ -66,7 +66,7 @@ export let debit = async (
currency,
type,
ref,
- created: Date.now()
+ created: Date.now(),
};
await s(`payment:${id}`, p);
@@ -98,7 +98,7 @@ export let credit = async (hash, amount, memo, ref, type = types.internal) => {
ref,
type,
confirmed: true,
- created: Date.now()
+ created: Date.now(),
};
let { tip } = invoice;
@@ -141,6 +141,8 @@ export let credit = async (hash, amount, memo, ref, type = types.internal) => {
export let confirm = async (address, txid, vout) => {
let id = `payment:${txid}:${vout}`;
let p = await g(id);
+ if (!p) return db.sAdd("missed", id);
+
p.confirmed = true;
await db