diff options
| author | Adam Soltys <[email protected]> | 2020-08-03 22:38:36 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2020-08-03 22:38:36 -0700 |
| commit | ba07b04fbbf9de058907db50a01daebf2ff4d6bb (patch) | |
| tree | b3c6e78458c708c6b5789f394fcfde1979a8912b /lib | |
| parent | 2bcd5e9cd2233934b6d78724a07172b187ceb0b0 (diff) | |
| download | coinos-server-ba07b04fbbf9de058907db50a01daebf2ff4d6bb.tar.gz coinos-server-ba07b04fbbf9de058907db50a01daebf2ff4d6bb.zip | |
handle liquid payments to user url
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sockets.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sockets.js b/lib/sockets.js index 117a8d67..9e683e0c 100644 --- a/lib/sockets.js +++ b/lib/sockets.js @@ -11,10 +11,11 @@ const subscriptions = []; emit = (username, type, data) => { if (data.username !== undefined) data = pick(data, ...whitelist); + l.info("msg", data); if (type === "payment" && data.amount > 0) { for (let i = subscriptions.length - 1; i >= 0; i--) { let s = subscriptions[i]; - if (s.invoice.amount === data.amount) { + if (s.invoice.amount === data.amount || s.invoice.address === data.address || s.invoice.unconfidential === data.address) { s.ws.send(JSON.stringify({ type, data })); subscriptions.splice(i, 1); } @@ -134,6 +135,7 @@ wss.on("connection", function (ws, req) { } break; case "subscribe": + l.info("subscribe", data.amount); subscriptions.push({ invoice: data, ws }); break; default: |
