diff options
| author | Adam Soltys <[email protected]> | 2021-05-24 16:44:47 -0400 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2021-05-24 16:44:47 -0400 |
| commit | 205b9ba828922e0ff8d1b47481a569d199d43201 (patch) | |
| tree | 957d41e2ec8d63ab6dadd21061a87ff2dd84789b /routes/bitcoin | |
| parent | 3ce9c73b1d4a281fe1475206d49c4f436e0b992e (diff) | |
| download | coinos-server-205b9ba828922e0ff8d1b47481a569d199d43201.tar.gz coinos-server-205b9ba828922e0ff8d1b47481a569d199d43201.zip | |
check for payment address
Diffstat (limited to 'routes/bitcoin')
| -rw-r--r-- | routes/bitcoin/receive.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/routes/bitcoin/receive.js b/routes/bitcoin/receive.js index 1784fd5f..e76c3664 100644 --- a/routes/bitcoin/receive.js +++ b/routes/bitcoin/receive.js @@ -154,8 +154,9 @@ setInterval(async () => { transaction }); - - ({ address, user } = p); + + if (p && p.address) address = p.address; + if (p && p.user) user = p.user; if (p && p.account) { ({ account } = p); @@ -179,16 +180,16 @@ setInterval(async () => { l.info("bitcoin confirmed", user.username, p.amount, p.tip); notify(user, `${total} SAT payment confirmed`); } else { - l.warn("couldn't find payment", hash); + l.warn("couldn't find bitcoin payment", hash); } + + delete queue[hash]; }); let c = convert[address]; - if (c) { + if (address && c) { user.account = account; - delete queue[hash]; - await sendLiquid({ address: c.address, amount: total - 100, @@ -198,6 +199,6 @@ setInterval(async () => { } } } catch (e) { - l.error("problem processing queued bitcoin transaction", e.message); + l.error("problem processing queued bitcoin transaction", e.message, e.stack); } }, 1000); |
