From f967c4d76bad49312b15460741adebfc84968cd6 Mon Sep 17 00:00:00 2001 From: shunmugam Date: Wed, 18 Sep 2019 13:34:54 +0530 Subject: [PATCH] Change query where condition --- server/utils/common.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/utils/common.ts b/server/utils/common.ts index 14e0f9b..e13ba63 100644 --- a/server/utils/common.ts +++ b/server/utils/common.ts @@ -352,13 +352,14 @@ const averageblockdifficulty = async() => { const BlockchainBlockPerSecondQuery = await getConnection(Global.network) .query( - "select 86400/count(hash) as period \ + "select count(hash) as mhash, 86400/count(hash) as period \ from blockchain_block \ - where height != 0 AND timestamp < NOW() - INTERVAL '24 HOURS' " + where height != 0 AND timestamp at time zone '" +process.env.TIME_ZONE+ "' > NOW() - INTERVAL '24 HOURS' " ) .catch(err_msg => { return(err_msg); }); + console.log(BlockchainBlockPerSecondQuery); return BlockchainBlockPerSecondQuery[0]['period']; }