Merge pull request #1935 from mempool/nymkappa/bugfix/handle-error-pool-hashrate

Handle pool dominance query error with 0 indexed blocks
This commit is contained in:
wiz 2022-07-06 22:02:25 +02:00 committed by GitHub
commit f5271bc7b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,6 +79,9 @@ class HashratesRepository {
interval = Common.getSqlInterval(interval);
const topPoolsId = (await PoolsRepository.$getPoolsInfo('1w')).map((pool) => pool.poolId);
if (topPoolsId.length === 0) {
return [];
}
let query = `SELECT UNIX_TIMESTAMP(hashrate_timestamp) as timestamp, avg_hashrate as avgHashrate, share, pools.name as poolName
FROM hashrates