Add setting to disable database use.

This commit is contained in:
softsimon committed 2020-07-23 00:04:29 +07:00
1 parent 251b8cdd8d
commit 86c0a5ec7b
4 files changed
+9 -18

No files matched your search

-15
View File
@@ -1,5 +1,4 @@
import projectedBlocks from './mempool-blocks';
import { DB } from '../database';
class FeeApi {
constructor() { }
@@ -28,20 +27,6 @@ class FeeApi {
'hourFee': thirdMedianFee,
};
}
public async $getTransactionsForBlock(blockHeight: number): Promise<any[]> {
try {
const connection = await DB.pool.getConnection();
const query = `SELECT feePerVsize AS fpv FROM transactions WHERE blockheight = ? ORDER BY feePerVsize ASC`;
const [rows] = await connection.query<any>(query, [blockHeight]);
connection.release();
return rows;
} catch (e) {
console.log('$getTransactionsForBlock() error', e);
return [];
}
}
}
export default new FeeApi();