diff options
| author | Adam Soltys <[email protected]> | 2021-08-10 16:06:22 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2021-08-10 16:06:32 -0700 |
| commit | 6510e2e72adc107fb6fb341c8dd4641f84586634 (patch) | |
| tree | 126b45449fb09cff45c86135901412d0292d4e33 /routes/bitcoin | |
| parent | fff03f6ba675d61b31cc981bcf751dc1b2fadd21 (diff) | |
| download | coinos-server-6510e2e72adc107fb6fb341c8dd4641f84586634.tar.gz coinos-server-6510e2e72adc107fb6fb341c8dd4641f84586634.zip | |
call webhook for internal transfers
Diffstat (limited to 'routes/bitcoin')
| -rw-r--r-- | routes/bitcoin/receive.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/routes/bitcoin/receive.js b/routes/bitcoin/receive.js index 603db47b..d9274935 100644 --- a/routes/bitcoin/receive.js +++ b/routes/bitcoin/receive.js @@ -126,16 +126,16 @@ zmqRawTx.on("message", async (topic, message, sequence) => { }); zmqRawBlock.on("message", async (topic, message, sequence) => { - const payments = await db.Payment.findAll({ - where: { confirmed: false }, - }); + const payments = await db.Payment.findAll({ + where: { confirmed: false }, + }); - let block = bitcoin.Block.fromHex(message.toString("hex")); - block.transactions.map((tx) => { - let hash = reverse(tx.getHash()).toString("hex"); - if (payments.find((p) => p.hash === hash)) queue[hash] = 1; - }); + let block = bitcoin.Block.fromHex(message.toString("hex")); + block.transactions.map((tx) => { + let hash = reverse(tx.getHash()).toString("hex"); + if (payments.find((p) => p.hash === hash)) queue[hash] = 1; }); +}); setInterval(async () => { try { |
