aboutsummaryrefslogtreecommitdiffstats
path: root/routes/bitcoin
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-09-06 10:30:03 -0700
committerAdam Soltys <[email protected]>2022-09-06 10:30:03 -0700
commit9121a73d4a5ee340f6c9d3b68186493b7d1bf29a (patch)
tree8442761c1b8b8afb36be25b831842cbcac1c9c05 /routes/bitcoin
parentc2464b2407ee23134732fd67586758dbfe18f9b5 (diff)
downloadcoinos-server-9121a73d4a5ee340f6c9d3b68186493b7d1bf29a.tar.gz
coinos-server-9121a73d4a5ee340f6c9d3b68186493b7d1bf29a.zip
missing imports
Diffstat (limited to 'routes/bitcoin')
-rw-r--r--routes/bitcoin/receive.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/routes/bitcoin/receive.js b/routes/bitcoin/receive.js
index 15e21121..f39d43b5 100644
--- a/routes/bitcoin/receive.js
+++ b/routes/bitcoin/receive.js
@@ -1,4 +1,6 @@
import config from "$config";
+import db from "$db";
+import bc from "$lib/bitcoin";
import { emit } from "$lib/sockets";
import store from "$lib/store";
import { notify } from "$lib/notifications";
@@ -10,6 +12,7 @@ import { fromBase58 } from 'bip32';
import bitcoin from 'bitcoinjs-lib';
import { sendLiquid } from "$routes/liquid/send";
import { computeConversionFee } from './conversionFee';
+import { l, warn, err } from "$lib/logging";
const zmqRawBlock = zmq.socket("sub");
zmqRawBlock.connect(config.bitcoin.zmqrawblock);
@@ -52,13 +55,13 @@ zmqRawTx.on("message", async (topic, message, sequence) => {
}
if (
- Object.keys(addresses).includes(address) &&
+ Object.keys(store.addresses).includes(address) &&
!store.change.includes(address)
) {
await db.transaction(async transaction => {
let user = await db.User.findOne({
where: {
- username: addresses[address]
+ username: store.addresses[address]
},
transaction
});
@@ -229,7 +232,7 @@ setInterval(async () => {
notify(user, `${total} SAT payment confirmed`);
callWebhook(p.invoice, p);
- let c = convert[address];
+ let c = store.convert[address];
if (address && c) {
l(
"bitcoin detected to conversion address",