diff options
| author | Adam Soltys <[email protected]> | 2025-01-23 20:23:09 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-01-23 20:23:10 +0000 |
| commit | 7ae9d76d8e625ab321786ef524da386408268a1f (patch) | |
| tree | 648fbe4c80a8efcce3b17a0f722a86210a1b95ba /lib/lightning.ts | |
| parent | 05ab044fa555c9e9b0d8f947e600d9c2f524c34d (diff) | |
| download | coinos-server-7ae9d76d8e625ab321786ef524da386408268a1f.tar.gz coinos-server-7ae9d76d8e625ab321786ef524da386408268a1f.zip | |
check if bolt11
Diffstat (limited to 'lib/lightning.ts')
| -rw-r--r-- | lib/lightning.ts | 6 |
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); |
