Add setting to disable database use.

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

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();