aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/lightning.ts6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/lightning.ts b/lib/lightning.ts
index 3888a405..f63b57be 100644
--- a/lib/lightning.ts
+++ b/lib/lightning.ts
@@ -25,8 +25,7 @@ export async function listenForLightning() {
try {
if (!preimage) return;
- const id =
- (await g(`invoice:${bolt11}`)) || (await g(`invoice:${local_offer_id}`));
+ const id = bolt11 ? (await g(`invoice:${bolt11}`)) : (await g(`invoice:${local_offer_id}`));
const invoice = await g(`invoice:${id}`);
if (!invoice) return warn("received lightning with no invoice", bolt11);
@@ -74,8 +73,7 @@ export async function replay(index) {
try {
if (!preimage) return;
- const id =
- (await g(`invoice:${bolt11}`)) || (await g(`invoice:${local_offer_id}`));
+ const id = bolt11 ? (await g(`invoice:${bolt11}`)) : (await g(`invoice:${local_offer_id}`));
const invoice = await g(`invoice:${id}`);
if (!invoice) return warn("received lightning with no invoice", bolt11);