aboutsummaryrefslogtreecommitdiffstats
path: root/routes/bitcoin
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2021-08-06 14:58:01 -0700
committerAdam Soltys <[email protected]>2021-08-06 14:58:01 -0700
commit7f427d1c9e229bfd70e913db451a873ce561b8db (patch)
treee7066971a2c9c41d3ec8f51c6439d3c0c0245c0f /routes/bitcoin
parent262e4bb11fedf1215bef58a7e472920e808a2d7e (diff)
downloadcoinos-server-7f427d1c9e229bfd70e913db451a873ce561b8db.tar.gz
coinos-server-7f427d1c9e229bfd70e913db451a873ce561b8db.zip
fix zmq 6 syntax
Diffstat (limited to 'routes/bitcoin')
-rw-r--r--routes/bitcoin/receive.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/routes/bitcoin/receive.js b/routes/bitcoin/receive.js
index 572987cc..2e8114dd 100644
--- a/routes/bitcoin/receive.js
+++ b/routes/bitcoin/receive.js
@@ -7,7 +7,7 @@ const bitcoin = require("bitcoinjs-lib");
const zmqRawBlock = new zmq.Subscriber();
zmqRawBlock.connect(config.bitcoin.zmqrawblock);
-zmqRawBlock.subscribe("rawtx");
+zmqRawBlock.subscribe("rawblock");
const zmqRawTx = new zmq.Subscriber();
zmqRawTx.connect(config.bitcoin.zmqrawtx);
@@ -18,7 +18,7 @@ const network =
config.bitcoin.network === "mainnet" ? "bitcoin" : config.bitcoin.network
];
-let queue = {};
+const queue = {};
(async () => {
for await (const [topic, message] of zmqRawTx) {
@@ -127,7 +127,9 @@ let queue = {};
})
);
}
+})();
+(async () => {
for await (const [topic, message] of zmqRawBlock) {
const payments = await db.Payment.findAll({
where: { confirmed: false },