diff options
| author | Adam Soltys <[email protected]> | 2020-11-12 16:34:06 -0500 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-11-12 16:34:06 -0500 |
| commit | 42ad55c926902587affc34a484396a00e16d534e (patch) | |
| tree | dfe9ae077436c62c3edfecd7515de8a9afc25e31 | |
| parent | 52ca1e9feac644f6ec4364bf60bf1c3f6bf748ad (diff) | |
| download | coinos-server-42ad55c926902587affc34a484396a00e16d534e.tar.gz coinos-server-42ad55c926902587affc34a484396a00e16d534e.zip | |
fix lnurl pay bug
| -rw-r--r-- | routes/lnurl.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/routes/lnurl.js b/routes/lnurl.js index 006ee0c9..04cadc13 100644 --- a/routes/lnurl.js +++ b/routes/lnurl.js @@ -166,7 +166,7 @@ app.post( params: { callback, k1 } } = req.body; - const url = `${callback}?amount=${amount * 1000}&comment=${comment}`; + const url = `${callback}${callback.includes('?') ? '&' : '?'}amount=${amount * 1000}${comment ? '&comment=' + comment : ''}`; try { const parts = callback.split("/"); @@ -177,7 +177,6 @@ app.post( res.send(await send(amount, "", result.pr, user)); } catch (e) { l.error("failed to send payment", e.message); - throw e; res.status(500).send(e.message); } }) |
