diff options
| author | Adam Soltys <[email protected]> | 2025-07-31 21:45:58 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-07-31 21:45:58 -0700 |
| commit | f1fa75ee43bad1f9c5ea06f4160cfee9847a035f (patch) | |
| tree | 1cce98dbf60b5b6da0f072bf9fa3639f75933568 | |
| parent | 7032731d56ccb0d5b158b08b81fcf1c9e4e4211e (diff) | |
| download | coinos-server-f1fa75ee43bad1f9c5ea06f4160cfee9847a035f.tar.gz coinos-server-f1fa75ee43bad1f9c5ea06f4160cfee9847a035f.zip | |
only record invoice if amount is defined
| -rw-r--r-- | routes/lnurl.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/routes/lnurl.ts b/routes/lnurl.ts index 00167291..239da2bd 100644 --- a/routes/lnurl.ts +++ b/routes/lnurl.ts @@ -208,11 +208,13 @@ export default { ]); const id = v4(); - await s(`lnurl:${id}`, uid); - await s(`lnurl:${id}:invoice`, invoice.id); + const total = (parseInt(invoice.amount || 0) + parseInt(invoice.tip || 0)) * 1000; + await s(`lnurl:${id}`, uid); + if (total > 0) await s(`lnurl:${id}:invoice`, invoice.id); + res.send({ allowsNostr: true, minSendable: invoice.amount ? total : 1000, |
