From d81ef512621400674c0487c9842b742ba3fc86d4 Mon Sep 17 00:00:00 2001 From: "raja.blaze" Date: Tue, 20 Aug 2019 11:00:39 +0530 Subject: [PATCH] socket updated --- server.ts | 6 +++--- server/socket/block.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server.ts b/server.ts index f91e970..c659873 100644 --- a/server.ts +++ b/server.ts @@ -187,9 +187,9 @@ console.log(__dirname); }); const io = require("socket.io").listen(server); io.sockets.on("connection", socket => { - // setInterval(function() { - // universalGetLatestBlockDetails(socket); - // },1000); + setInterval(function() { + universalGetLatestBlockDetails(socket); + },1000); }); }) .catch(error => { diff --git a/server/socket/block.ts b/server/socket/block.ts index dbd865a..8e52871 100644 --- a/server/socket/block.ts +++ b/server/socket/block.ts @@ -78,9 +78,9 @@ export async function universalGetLatestBlockDetails(socket) { letest_block_num = "", letest_block_duration = ""; - const BlockchainLatestBlockQuery = await getConnection(Global.network).query( + const BlockchainLatestBlockQuery = await getConnection("Testnet").query( "SELECT bb.timestamp,bb.proof,bb.height,bb.edge_bits,bb.hash,bb.secondary_scaling, bb.previous_id, bb.total_difficulty_cuckaroo, bb.total_difficulty_cuckatoo, bb.total_difficulty_progpow, bb.total_difficulty_randomx, COUNT(DISTINCT(bi.block_id)) AS input_count, COUNT(DISTINCT(bk.block_id)) AS kernel_count, COUNT(DISTINCT(bo.block_id)) AS output_count FROM blockchain_block bb LEFT JOIN blockchain_input bi ON bi.block_id = bb.hash LEFT JOIN blockchain_kernel bk ON bk.block_id = bb.hash LEFT JOIN blockchain_output bo ON bo.block_id = bb.hash group by bb.hash, bb.timestamp ORDER BY bb.timestamp DESC LIMIT 1"); - const BlockchainPreviousBlockQuery = await getConnection(Global.network).query( + const BlockchainPreviousBlockQuery = await getConnection("Testnet").query( "SELECT total_difficulty_cuckaroo, total_difficulty_cuckatoo, total_difficulty_progpow, total_difficulty_randomx FROM blockchain_block WHERE hash=" + "'" + BlockchainLatestBlockQuery[0].previous_id +